Jump to content

memory leak?


Baker Xiao
 Share

Recommended Posts

During a recent profiling we found that a Scene object is being retained in the heap infinitely even if dispose is called.

Apparently the Engine keeps an array of compiledEffects which then has fallback meshes that keep a reference to the scene and that prevented the scene object from being garbage collected. 

image.png.9b3c27d655c394c6a5b0e5a873ee06dc.png

 

Is this expected? There's about 9MB of stuff that can be wiped out from our pathetic mobile device memory, so definitely hoping there's a way to collect it. :)

Link to comment
Share on other sites

BTW, we tried Engine.releaseEffects(). Unfortunately it doesn't help our case because what we are doing is that we are constructing scene2 when scene1 is about to end. During the construction of scene2, this https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.engine.ts#L2192 would leak an effect that references scene1 into scene2 making the whole scene1 object tree retained in the heap. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...