2
votes

i have been testing my application on 4 IOS devices. 1 ipod touch 2g, 1 iPhone 3gs, two iPhone 4's. On the iPhone 4's my application will take up about 30-50mb of memory while running. On the 3Gs it will take about 15-30mb, and on the iPod it will take about 15-27mb of memory.

Is there any kind of rule against how much memory your application can use? The app doesnt crash on any of them, but i thought i read somewhere that the max is like 20mb of memory usage?

Frankly im surprised that the iPod touch 2g is able to run the thing, i was told that the max youll ever get out of iPod 2g is like 20 mb of ram.

Now i have another question, while running Instruments, does it add any amount of memory usage on the device? It seems like while running instruments the application lags more than when not running with it.

Thanks, Jacob

2

2 Answers

10
votes

There is no exact limit. Technically, your app can use "up to the total amount of memory currently available", but that amount will vary depending upon things like device model, iOS version, what other apps are running in the background, and so on.

Speaking very generally, if you want your app to run reliably on older devices like the iPhone 3G you should shoot for 10-15 MB of RAM. For newer devices 30+ MB should not be a problem. Meaning that while it's always good to reduce this amount if you can, your app should still function okay even if you don't.

Also note that the memory warnings sent by the device are not very useful or indicative of a specific memory limit. They are not saying that your app is using too much memory in any absolute sense. Instead they just say that the current device, with its current working-set of apps, is running low on memory. You can safely ignore them if you prefer, and let the OS shut down some other apps to make room for yours.

Regarding instruments lagging the app, instruments is polling the device for details about the application's current state and other historical information. There is overhead associated with collecting and communicating this information. In terms of impact on the space requirements for your app, they should be negligible, however.

1
votes

You will usually get a memory warning when you hit 22 MB. Instruments does slow down the processing but it does not add any additional memory usage on the device.