iTGB Memory Usage (iPhone specific)
by John F · in Torque Game Builder · 01/15/2009 (5:57 pm) · 0 replies
My iPhone game is sometimes terminating due to memory exhaustion. It is not clear to me why this is the case given that I am allocating all game objects during game initialization and never delete or create anything afterward. Even so, sometimes the game plays for a long period with no problem and other times it will terminate several times spaced close together. If it is not a leak then perhaps I'm just using too much memory overall. However if this were the case I would expect more consistent behavior. I need to understand iPhone memory allocation better and how I might address the problem in iTGB. If anyone can help me with these questions it would be much appreciated.
1) What is the process for compressing PNG images? The GarageGames iTGB page talks about PowerVR Texture Compression. Other iPhone documentation I have read discusses a utility called pngcrush.
2) My game uses a static sprite which I clone 81 times. Does each clone have its own copy of the PNG or do they share a single image in memory? I also use a single image to paint each tile in a tile map. Does each tile in the map have its own copy of the image in memory or do they share a single copy?
3) I use large images in some of my GUIs. How can I ensure that these are not loading until the GUI is made visible and and that they are unload afterward?
4) On the iPhone is the running application sharing memory with any other apps? Does termination of an application free any leaked memory?
5) For a given iPhone device will the application always have the same amount of memory available on launch?
6) Is there a way to ask iTGB how much memory it has allocated?
Any other tips about memory usage, allocation or leaks on the iPhone would be terrific.
Thanks,
John
1) What is the process for compressing PNG images? The GarageGames iTGB page talks about PowerVR Texture Compression. Other iPhone documentation I have read discusses a utility called pngcrush.
2) My game uses a static sprite which I clone 81 times. Does each clone have its own copy of the PNG or do they share a single image in memory? I also use a single image to paint each tile in a tile map. Does each tile in the map have its own copy of the image in memory or do they share a single copy?
3) I use large images in some of my GUIs. How can I ensure that these are not loading until the GUI is made visible and and that they are unload afterward?
4) On the iPhone is the running application sharing memory with any other apps? Does termination of an application free any leaked memory?
5) For a given iPhone device will the application always have the same amount of memory available on launch?
6) Is there a way to ask iTGB how much memory it has allocated?
Any other tips about memory usage, allocation or leaks on the iPhone would be terrific.
Thanks,
John