Experiments with GS Memory Management
Hi,
I was doing some tests to see how much I could push a game I'm doing. What concerned me the most was if the GS engine was able to effectively dump memory.
What I did was creating a simple app with one scene and one actor that every time it was touched changed it's image with a new one. I added to the project about 300 images 480x320 to test it.
The result with the iPhone 4 was that every time the total memory reached about 246/250 MB all the image memory reset to 0 and then it began again to raise.
I tested also with an iPod Touch 3rd gen and it reset the image memory every time the total memory reached about 119/122 MB.
In both cases if there were other apps open in background the memory would reset when the total memory reached lower numbers. Apparently the engine sees how much memory is used and when the total reaches about half of the total available memory of the device it starts to dump some of it.
I haven't tested it with sounds but if it continue to works like this I think that it will be very difficult for our apps to crash even if a lot of images are used in the same scene.
Thanks GS for this.
________________________________
Mark On The Iron - 【ツ】iPhone Icon Pack【ツ】 - 【ツ】Graphic Pack【ツ】
Free GS demos: High score simple and advanced; Game Center; App Rating System; Custom Font Score and Countdown; Advanced Snap to Grid
I was doing some tests to see how much I could push a game I'm doing. What concerned me the most was if the GS engine was able to effectively dump memory.
What I did was creating a simple app with one scene and one actor that every time it was touched changed it's image with a new one. I added to the project about 300 images 480x320 to test it.
The result with the iPhone 4 was that every time the total memory reached about 246/250 MB all the image memory reset to 0 and then it began again to raise.
I tested also with an iPod Touch 3rd gen and it reset the image memory every time the total memory reached about 119/122 MB.
In both cases if there were other apps open in background the memory would reset when the total memory reached lower numbers. Apparently the engine sees how much memory is used and when the total reaches about half of the total available memory of the device it starts to dump some of it.
I haven't tested it with sounds but if it continue to works like this I think that it will be very difficult for our apps to crash even if a lot of images are used in the same scene.
Thanks GS for this.
________________________________
Mark On The Iron - 【ツ】iPhone Icon Pack【ツ】 - 【ツ】Graphic Pack【ツ】
Free GS demos: High score simple and advanced; Game Center; App Rating System; Custom Font Score and Countdown; Advanced Snap to Grid
Comments
And GS, thanks from me too! It sounds far more effective memory management than even a couple of beta ago.
----------------------------------------------
http://davidgriffinapps.co.uk/
iPad: End of the Earth game coming soon to the iTunes App Store....
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Somehow I'm still getting crashes due to memory on an ipod 4. I did a test with most of the images in the scene deleted and then it never crashed. So it's definitely a memory issue. So now doing another round of optimisation.
This is a game started ages ago in an old GS build, so not sure if that will make a difference.