Currently, I'm building my first app for the app store therefore I have read here, that an app should use less than 30 MB of RAM (iPhone 3G, iPhone 4). I have read that, at some point in time, iOS will start hunting for the resources by randomly killing and freeing sounds, images and other resources from the background apps. Currently, my app uses ~5MB of live bytes that are showed in instruments but I feel some paranoia about memory :) Am I safe when app uses less that 10MB when targeting iPhone3G and iPhone4?
The question is if an app goes to background then how much of resources iOS can free of it until finally killing it? If my app goes to background and then 100 or more others apps will be launched then what happens to my app? I do not believe that RAM memory piece is static for my app because the memory in each device is limited. IMHO, if you start looping with opening a new app, sending it to the background, opening another one - then device RAM will be totally used at some point in time. Then, theoretically, if you try to open a new app then some very first opened apps should be killed by iOS...
Currently, I'm building small game with pure UIKit, therefore I use a lot of UIView and UIViewImage objects and I'm not sure how to deal with this theoretical situation. During entering the background, my app might gave loaded a lot of in game UIViewImages, pointer to menu MVC and etc. Do I have to code some reloadALL method for reloading every peace of the game? Everything would be OK if iOS would kill my whole app if device memory is totally used. But it would be unacceptable if iOS would release some of my UIViewImage in game or menu objects. In that case, I don't know what kind of "zombie" (how many legs, arms and etc my app could have after a "resurrection") my app could be. Please share your experience and thoughts :)