ForgeableSum Posted June 23, 2015 Share Posted June 23, 2015 I'm looking for advice on how to identify cpu/memory leaks. I've not had a lot of experience using the profiler in Google chrome. Experimenting with it, I've found it to be very unintuitive. For example, what is it measuring, memory or CPU? If it only measures memory usage, how can you check cpu usage? Here's my problem: my game has this problem of spontaneously coming to a crawl apropos of nothing. It usually happens on page load. I will refresh the page and the framerate suddenly drops to 1-10. I try deleting literally every function in create and update but it still crawls when I refresh the page... it's literally crawling when there is nothing left but global variables and booting the game. I've tried everything: stripping it down to a barebones version, reverting to older versions, flushing cache, switching webgl/canvas modes but it randomly hangs for no reason whatsoever. honestly i've never seen anything like it. In the JS profiler, I am seeing that the highest total % is from "program" which I take it is Google Chrome itself. If 75% of memory is Chrome, does that fall to reason that memory is not the problem? Is "program" different from "idle"? What does it mean if program is taking up 75%??! It could be a bad thing or it could be completely normal. Link to comment Share on other sites More sharing options...
Skeptron Posted June 23, 2015 Share Posted June 23, 2015 This plugin can help a little : https://github.com/englercj/phaser-debug I also like to use https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en to be sure my cache is completely deleted. But otherwise I'm like you, I'd gladly take some advice for better debugging / profiling tools. Link to comment Share on other sites More sharing options...
ForgeableSum Posted June 24, 2015 Author Share Posted June 24, 2015 I've tried that plugin - unfortunately it show less information than Chrome's JS profiler. What I don't understand is how Chrome's profiler can be showing program or idle at 75% of self when the game's framerate is dipping below 10 fps... there must be some kind of tool which shows the total memory/cpu the tab has and the amount used, just like resource manager in mac or task manager in windows. Surely, there must be something out there. Link to comment Share on other sites More sharing options...
Skeptron Posted June 24, 2015 Share Posted June 24, 2015 This post also mentions suspicious idle behaviors that are hard to interprete : http://www.html5gamedevs.com/topic/15086-phaser-too-much-idle-time-on-each-frame/ I'd love to see some explanations on these things.. Link to comment Share on other sites More sharing options...
Recommended Posts