ok, I did some extensive testing.
I used a 442Kb 800x600 PNG image, and a Samsung Galaxy S II
The player on it own used from 7.08MB to 7.16MB between runs, probably because of memory fragmentation issues.
The test program with no media loaded, and no sprites used 8.75MB, and had 65FPS.
1 image loaded, 0 sprites = 10.28MB / 65FPS
2 images loaded, 0 sprites = 10.26MB / 60FPS (Less memory. Go figure)
4 images loaded, 0 sprites = 10.87MB / 60FPS
4 images loaded, 1 sprite = 11.90MB / 60FPS
4 images loaded, 10 sprites = 11.91MB / 60FPS
4 images loaded, 100 sprites = 11.98MB / 17FPS
4 images loaded, 500 sprites = 12.32MB / 5FPS
4 images loaded, 500 sprites (visible off) = 12.20MB / 60FPS
100 images loaded, 100 sprites (visible off) = 91.28MB / 60FPS
That's 100 unique images 800x600 pixels, and 100 sprites at 800x600 pixels, and i'm still having 450MB free on my phone.
If I started to delete all 500 sprites, and recreate them in every sync() I found that NO memory were freed, in fact it just started to eat away, and the memory usage went from 12.17MB to 12.42MB in just 10min. This is an extreme example, but it proves that every time you delete a sprite, you WASTE memory
I then set up to delete and load the first image, in every sync(), and that too ate memory, but only at a rate of around 0.03MB / minute, meaning the image data memory is recycled, but the image metadata is not garbage collected, and you waste memory.
So my conclusion. Delete and reload images when needed, that saves ram, but makes a very small memory leak too. Delete sprites if you have to, but that ALWAYS create a memory leak, and the amount of ram your app uses increase for each sprite you delete. It's better to just make them inactive. The amount of inactive sprites had no practical effect on the FPS.
The number of images loaded, and sprites created, has no effect on FPS, as long as they are visible off! If you hide them in the background, it has horrible effect on the FPS.
Now, I need to test if variables and arrays leak memory also...
----------------
AGK programmer
Did Amiga / AMOS programming in the 90's.