Memory management when the app quits

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

  1. jaycyn94 macrumors newbie

    jaycyn94

    Joined:
    Jul 18, 2007
    #1
    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

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #2
    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

    Joined:
    Apr 24, 2007
    Location:
    San Francisco Bay Area
    #3
    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

    jaycyn94

    Joined:
    Jul 18, 2007
    #4
    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