PDA

View Full Version : Memory management when the app quits




jaycyn94
Mar 15, 2009, 05:13 PM
One thing I have been wondering about but haven't seen an answer too in regards to memory management:

When the app is closed/terminates, is all memory released (i.e. in a sandbox), or can unreleased memory linger and affect other apps or the iPhone OS?

Just something I was wondering about.



caveman_uk
Mar 16, 2009, 04:16 AM
It should all be released when the app terminates - that's not a reason not to do it properly to start with

yayaba
Mar 16, 2009, 04:42 AM
One thing I have been wondering about but haven't seen an answer too in regards to memory management:

When the app is closed/terminates, is all memory released (i.e. in a sandbox), or can unreleased memory linger and affect other apps or the iPhone OS?

Just something I was wondering about.

I think the iPhone effectively terminates the process so any memory associated with it is freed up.

The things you should probably be doing when catching the applicationWillTerminate is just to write user settings or your current app state, probably don't have to worry about freeing up memory.

jaycyn94
Mar 16, 2009, 09:46 AM
The reason I asked wasn't to try to cut corners. I was adding an entry to my rootviewcontroller's dealloc method and it just started me thinking if a poorly written app could leave lingering memory around. Wasn't sure so I looked around and asked.

Years of Java programming have rusted up my memory management skills.