Wingnut Posted September 12, 2016 Share Posted September 12, 2016 Hi Gang! I rarely start posts, but I am checking on a slow browser crasher that COULD be a memory leak. http://playground.babylonjs.com/#1AVEYO#36 I'm not really qualified to comment on performance and memory issues, but others nearby are quite good at "watching the numbers". I think the numbers are worth watching, here. I see memory usage continuously increasing and this crashes Firefox after about 30 minutes... on my machine. Thanks to all investigators. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 12, 2016 Share Posted September 12, 2016 I think it's cause your beta after 30 mins is a huge number. Try having the beta roll back to 0 at certain points that do not effect your animation. thats the only thing I could see after a quick glance that would be causing ram to build up, but I'm not sure if that would be the cause. yeah just looking at it on my phone I think it's your alpha and beta values I'm just on my phone but what's its alpha and betas value after 10mins? Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 I don't know what the issue is, but it is not due to large numbers. Maybe I don't understand what you're saying, though. Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 This version doesn't seem to have a memory issue: http://playground.babylonjs.com/#1AVEYO#38 Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 Neither does this version: http://playground.babylonjs.com/#1AVEYO#39 It seems to have something to do with "makeItUnique" being set to true for updateVerticesData. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 12, 2016 Author Share Posted September 12, 2016 Thanks, guys. I think I'm still seeing creap'n'seep on #38. I open my Windows performance monitor, and watch the numbers on the "memory" window... on the row for Firefox. There are 4 columns I am watching... commit, working Set, Shareable, and Private. Shareable is holding steady, but the other 3 are slowly on their way to the moon. I better submit this before my browser puffs. Been about 15 mins since I started #38 running. (Wingy dons his crash helmet and fire suit.) heh btw, this is not my playground... just one I had bookmarked cuz I loved it so much. I recently put colors on it. Purrrrdy. I am collecting a huge pile of great playgrounds (URLs) so I can add them to Temechon's "Cool Playgrounds" doc... eventually. Probably need two categories. Best-Code Playgrounds, and Prettiest Playgrounds. #38 is still holding well. After GC (or something), it pulls its numbers back into shape rather nicely. Maybe our investigators have been successful! YAY! Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 I'm letting 39 run for a few minutes here and have run the chrome dev tools timeline a few times. The highest I've seen the memory go is 63MB. The graph of the timeline goes up and down, but never goes above 63MB. When I run 36, the graph is clearly going up. Memory is at 74MB in the first 40 seconds, 119MB after the first minute and it continues rising. I'll let 39 run for a good 30 minutes and see if it is still steady. Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 After 30 minutes of running #39 on half of my screen, it is at about 37MB. When makeItUnique is used on #36, there must be a place in the code where the old geometry is still referenced. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 12, 2016 Author Share Posted September 12, 2016 38 still running perfect, here, after... a long time. Thanks for the find! Well done. Quote Link to comment Share on other sites More sharing options...
adam Posted September 12, 2016 Share Posted September 12, 2016 This makeGeometryUnique function seems to solve the issue: http://playground.babylonjs.com/#1AVEYO#43 Would there be a reason not to dispose the old geometry? Edit: this probably isn't a good fix, because I'm think makeGeometryUnique is used when cloning a mesh. It wouldn't make sense to trash the original geometry. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 14, 2016 Author Share Posted September 14, 2016 Thanks for the legwork, @adam I'm going to ping @Deltakosh... just in case this topic is pertinent to him. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 14, 2016 Share Posted September 14, 2016 You know that I read all posts I've fixed the makeGeometryUnique function! Thanks guys Wingnut, dbawel and fluffrabbit 3 Quote Link to comment Share on other sites More sharing options...
adam Posted September 14, 2016 Share Posted September 14, 2016 On 9/12/2016 at 2:44 PM, adam said: Edit: this probably isn't a good fix, because I'm think makeGeometryUnique is used when cloning a mesh. It wouldn't make sense to trash the original geometry. I see that releaseForMesh checks the number of meshes before disposing. Nice. https://github.com/BabylonJS/Babylon.js/blob/d116cde676ba5e74dfbf25c1349d981a9b94c713/src/Mesh/babylon.geometry.js#L263 Next time I'll just submit a PR so that I can get some github cred. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 14, 2016 Author Share Posted September 14, 2016 On 9/12/2016 at 1:44 PM, adam said: this probably isn't a good fix It was that comment that made me... umm... ...let's just say... the more, the merrier. An official invitation to Deltakosh... to join us at this campfire conversation... is... you know... proper diplomatic protocol. heh 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.