Note that there are some explanatory texts on larger screens.

plurals
  1. POAS3 large game performance degradation over time
    text
    copied!<p>I'm currently working on a very large Flash platformer game (hundreds of classes) and dealing with an issue where the game slowly grinds to a halt if you leave it on for long enough. I didn't write the game and so I'm only vaguely familiar with its internals. Some of the mysterious symptoms include,</p> <ul> <li>The game will run fine for a determinate amount of time (on a given level) when all of a sudden it will exponentially start leaking memory.</li> <li>The time it takes for the game to hit the point where it leaks exponentially is shorter when there's more sprites on the screen.</li> <li>Even when nothing is being visibly rendered to the screen, the game slows down.</li> <li>The game slows down faster with more frequent sprite collisions.</li> <li>Completely disabling the collision code does slow down the degradation but doesn't prevent the game from eventually dropping frames.</li> </ul> <p>Looking at the source and using Flex profiler, my prime suspects are,</p> <ul> <li>There are many loitering objects, especially <code>WeakMethodClosure</code>, taking up large amounts of memory.</li> <li>The program makes extremely extensive use of weak event listeners (dozens dispatched per frame).</li> <li>BitmapData is being copied every time a new sprite is created. These are 50x50 pixel sprites that spawn at about 8 sprites per second.</li> </ul> <p>I know it's next to impossible to tell me the problem without seeing the source, so I'm just looking for tidbits that might help me narrow this down. Has anybody experienced this evasive performance degradation in their own projects? What was the cause in your case?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload