frilla frilla - 1 year ago 106
iOS Question

ios app maximum memory budget

I'm working on an ios game that's targeting as a minimum the 3gs. We are using HD assets for retina display devices (iphone 4, ipod touch 4th gen).

Memory wise, Ipod Touch 4th gen seems to be the most constraint device for us since it has the same amount of RAM (256 compared to Iphone 4's 512) as 3gs but we're using HD assets on it. The app used to crash when trying to load 100-110mb of ram but now that we're down to 70MB, we've never had loading crash.

After lots of searching around, there seems to be no official hard limit so how should we go about knowing what memory budget to use to be safe? We want to be able to give the artists a budget they can use without memory worries for each map.

Max Max
Answer Source

I think you've answered your own question: try not to go beyond the 70 Mb limit, however it really depends on many things: what iOS version you're using (not SDK), how many applications running in background, what exact memory you're using etc.

Just avoid the instant memory splashes (e.g. you're using 40 Mb of RAM, and then allocating 80 Mb's more for some short computation). In this case iOS would kill your application immediately.

You should also consider lazy loading of assets (load them only when you really need and not beforehand).