Memory management when the app quits

Discussion in 'iOS Programming' started by jaycyn94, Mar 15, 2009.

  1. jaycyn94 macrumors newbie


    Jul 18, 2007
    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.
  2. caveman_uk Guest


    Feb 17, 2003
    Hitchin, Herts, UK
    It should all be released when the app terminates - that's not a reason not to do it properly to start with
  3. yayaba macrumors 6502

    Apr 24, 2007
    San Francisco Bay Area
    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.
  4. jaycyn94 thread starter macrumors newbie


    Jul 18, 2007
    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.

Share This Page