Three.js: Memory increase when using wasm decoder in DRACO Loader

Created on 8 Mar 2019  路  7Comments  路  Source: mrdoob/three.js

Description of the problem

When using wasm decoder in DRACO Loader, the memory will increase even if you refresh page. And the memory will be freed when you close the tab.

The webgl_loader_draco example can reproduce this issue, just comment the following line, and it will use wasm decoder.

diff --git a/examples/webgl_loader_draco.html b/examples/webgl_loader_draco.html
index 1eaf08f2e..46c321f50 100644
--- a/examples/webgl_loader_draco.html
+++ b/examples/webgl_loader_draco.html
@@ -47,7 +47,7 @@

                // Configure and create Draco decoder.
                THREE.DRACOLoader.setDecoderPath( 'js/libs/draco/' );
-               THREE.DRACOLoader.setDecoderConfig( { type: 'js' } );
+               // THREE.DRACOLoader.setDecoderConfig( { type: 'js' } );
                var dracoLoader = new THREE.DRACOLoader();
                init();
                animate();

And then take heap snapshot:

image

Three.js version
  • [ ] Dev
  • [x] r102
  • [ ] ...
Browser
  • [ ] All of them
  • [x] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [ ] All of them
  • [x] Windows
  • [x] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Browser Issue

Most helpful comment

All 7 comments

I'm able to reproduce with Chrome 72.0.3626.121 on macOS. And yes, the memory does not increase when using the JavaScript version of the decoder.

However, I'm not able to reproduce the issue with Firefox 65.0.1.

image

This could indicate a browser issue. Can you also make a test with Firefox?

Yes, Firefox does not have this issue.

Do you mind filing a bug at the Chromium issue tracker?

https://bugs.chromium.org/p/chromium/issues/list

If this is a browser bug, there is nothing we can do here.

Does memory usage return to normal if you call THREE.DRACOLoader.releaseDecoderModule()? Note that after doing so, you won't be able to use the module without reloading the page (https://github.com/google/draco/issues/349).

As mentioned at the issue at bugs.chromium, the browser's task manager does not show the mentioned increase in memory. In any event, this is not a three.js issue so please continue the discussion at the Chromium bug tracker.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donmccurdy picture donmccurdy  路  3Comments

fuzihaofzh picture fuzihaofzh  路  3Comments

jack-jun picture jack-jun  路  3Comments

jlaquinte picture jlaquinte  路  3Comments

seep picture seep  路  3Comments