I am making a game using canvas and am in weird Chrome behavior that I cannot commit. Sometimes, when I download a game, the Chrome Task Manager reports that it allocates + 300 MB per second, increasing to a few GB of memory in just 10 seconds or so, and it does not stop until the tab stops.
When I try to run the javascript profiler, the problem stops. When I load the tab with the launch of the profiler, it is absolutely stable. When a problem occurs, and then I start the profiler, it will go from 1.5 GB to a stable 40 MB right away. And a heap shot shows me what I expect if the game is stable.
My game works on window.setInterval(I tried requestAnimationFrameand recursive setTimeout, and the problem still happens), and it happens more often when it is set high, which means that when I install the game at 30FPS, it rarely happens, and when I install it at 60FPS, this happens in half the cases. This only happens in Chrome, Firefox seems great.
How to debug this when Chrome seems to do garbage collection only when the profiler starts?
In addition, I noticed that some of my animations and keyboard input are a little funny when I press FPS on 60. I assume this may be related, but this also takes place in Firefox.
source
share