Jump to content

Dispose or recycle for performance


Raitch
 Share

Recommended Posts

When playing my game for a while it gets slower and slower. I'm trying to figure out why. One if my theories is that I create quite a few meshes and dispose them shortly after.

That's why I'm curious on if it will be worth trying to recycle most meshes through the use of LOD and positioning away instead of creating ad disposing. Or perhaps it won't really matter?

Are there any common practices to search for potential memory leaks?

Link to comment
Share on other sites

You'll need to use your browser's profiling to see what's slow. It could be excessive GCs, or functions getting de-optimized, or it could be a content problem (like meshes not getting disposed, so that the scene builds up a bunch of invisible junk), etc.

No way to fix it until you know what's slow!

Link to comment
Share on other sites

I recently ran into this same problem and did some testing on dispose() to see if it was leaving any assets behind on meshes.  I never found anything artifacts left after dispose.  what ended up being my problem were a few times I was updating an mesh with a new asset.  this left the old one orphaned in memory and was never GCed.  I went back and disposed() before changing the asset and it took care of my leak.  Best of luck!

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...