[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Frantic memory usage



I found some image filmstrips I was not unloading after they're cut up
into image arrays, and it freed up a decent amount of memory, but my
game is still a hog.  I totalled the amount of disk space for all images
used by the starship (different weapons, explosions, thruster, etc.),
and it's 600Kb.   However, when I comment out the line that loads the
starship_manager, the memory usage drops by a whopping 17Mb.   It's even
worse for the first enemy, which is loaded when the first level begins. 
355Kb of images, but the memory usage skyrockets another 40Mb when it
loads on the first level.

I'm doing something braindead somewhere, just haven't tracked it down
yet.   The code is spread across dozens of source files, but if anyone's
interested it's at http://medievalelks.com/code.zip.  I honestly don't
expect anyone to take the time to look at such a volume, but I've been
requested several times to post it so there it is.   I didn't include
any data files, just code.   

Anyway, I'm making some progress.   Oh, and I scaled down the game to
640x480, which also helps the performance.   Removed some
redundant-sounding music loops, too.   Download size is now a svelte
13Mb :-).