How much memory does iOS allow apps to use?

Marty picture Marty · Nov 13, 2010 · Viewed 7.2k times · Source

I am making an app that uses a lot of fairly big image files. I notice it crashes when they all get loaded on my iPhone 3G (128 mb ram), but not when I test it on a 3rd gen iPod (256 mb ram). So I assume there must be some percentage that is allowed for each app to use? My app has about 30 images at about 440k each loaded so 13.2mb. I didn't think that would be too much. They need to be swapped in and out pretty quickly, so releasing the ones not in use from memory doesn't seem like a good idea...

EDIT:

The app swaps images based on the way the phone is being tilted. It's 30 images from a 3D scene, so when you move it, it changes the perspective. It needs to be as smooth as possible.

Answer

David Liu picture David Liu · Nov 13, 2010

The answer is: as much as you want, until the OS complains.

There is no such thing as an absolute memory limit, since it wholly depends on the phone's memory, how much the OS and its related services are taking up, and the time of the month (just kidding, but you get the idea).

You should be scaling down these large image files to fit into memory, or even more so, not loading them all at once considering the screen is so small and only so much can be viewed at any one particular time.