Raitch Posted March 13, 2017 Share Posted March 13, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 13, 2017 Share Posted March 13, 2017 Hello, this is tough to identify without a repro case. Did you try to use memory profiler (f12 tools)? it could help identifying leaks Quote Link to comment Share on other sites More sharing options...
Raitch Posted March 14, 2017 Author Share Posted March 14, 2017 I've run through it a bit. Managed to save some by not having AssetsManager as global for instance. Can try to look through it some more. But creating and disposing a lot shouldn't matter? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 14, 2017 Share Posted March 14, 2017 It **should** not but we can have sneaky bugs.. Quote Link to comment Share on other sites More sharing options...
fenomas Posted March 15, 2017 Share Posted March 15, 2017 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! Quote Link to comment Share on other sites More sharing options...
boyofgreen Posted March 19, 2017 Share Posted March 19, 2017 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! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.