[Memory] iOS - Handling Texturesizes

Hey there.

So we’re working on a 2D Game with 2DToolkit for the iOS Plattform (targeting devices starting at the iPhone 3GS upward and the whole iPad-Family) and I’m wondering about a crucial thing: Memory. I’ve got “only” two devices to test the game: an iPhone4 and an iPad mini.

2DToolkit has a nice TextureAtlas-System which reduces the DrawCalls, which is great. Now the game runs on both devices smoothly with 60FPS with around 6 max 12 DrawCalls (nGUI Userinterface and some other stuff besides the Sprites…animations, Particles etc.) and over 100 Sprites which is great. It didn’t came to my mind till a friend of mine told me: “Yeah, that’s nice, indeed. But what about the memory?” And I asked myself: “Yeah, man, what about the memory!?”

So I started the Game in Unity and looked up the Editor-Log:

65MB just for textures. I don’t think that is a good sign. But the thing is, if I configure the settings of the Atlas-Textures (for example using the PVRCT Compression) the Sprites look horrible on the device. I already changed the Size/Format of the Textures down to the point where they look acceptable.

Then I wanted to know what XCode has to say. I profiled it with the Activity Monitor (The Game is the red one!):

1240352--52929--$bildschirmfoto_2013-05-08_um_19_33_12.png
1240352--52930--$bildschirmfoto_2013-05-08_um_19_33_26.png

As I progress through the first scene the game goes up to 96,79 MB and stays that way.
I didn’t receive any Memory-Warnings. Not on the iPhone 4, and not on the iPad Mini.
Now I would like to know: Is this bad? Is this way too much Memory-Usage for the targeted iOS-Devices?
I know what would be the solution: “Smaller Textures!” ← yeah! I would suggest so, too. But smaller = uglier. Is there a better compromise or another way than PVRCT Compression?

Rough “safe” memory usage estimate is 1/2 of total RAM amount on device.
For 3GS “safe” zone is ~110-120 MB.

People run a lot of apps on their device/jailbreaking/new os/notifications and so on 120 used to be safe but now I’m finding its even lower :frowning:

Thankfully according to stats.unity3d.com it looks like ipad1 and 3gs are on the way out (can’t remember if the ipod 4 is 256 or 512) … if the ipod4 is indeed 256, that means with retina we have a little more trouble…

@Hippocoder

iPhone 4 has 512 MB :slight_smile:

Thank you guys for the replies. I know it’s not a clear statement, but I think i’ll ty to aim not to get over 1/2 of the total RAM. But I woul be also grateful if there are some nicer solutions than PVRCT Compression.

iPod touch 4gen only has 256 MB of RAM, and yes, it is the most problematic device memory wise since iOS 6.

Which is precisely why i use this as my core memory-focussed tests. If it runs on this little bastard, it will run on all ;0

iPhone 3GS has also 256 RAM, hasn’t it? I don’t want to buy both of them for testing, if i haven’t to :smile: