Background apps

Discussion in 'iPhone 5S' started by silvermoon, Mar 11, 2014.

  1. silvermoon

    silvermoon Evangelist
    Gold

    Joined:
    Jul 17, 2013
    Likes Received:
    179
    I know a little about how iOS handles memory on the iPhone but my questions relate to if it is necessary to close an app once you are done using it. If it is not closed, does it continue to use up memory running in the bg? It is very time-consuming to have to swipe up on all of the applications that you want to quit running. But if the operating system knows that an app is idle.. is that still taking up memory? I'd like to understand more about the entire process.
     
  2. Europa

    Europa Moderator
    Senior Moderator

    Joined:
    Dec 12, 2008
    Likes Received:
    5,521
    Force closing them is not necessary. Take advantage of the multitasking and let the iPhone manage its own memory.
     
    • Like Like x 1
    • Agree Agree x 1
    • List
  3. rambo47

    rambo47 Contributor
    Silver

    Joined:
    Apr 4, 2010
    Likes Received:
    79
    Windows Mobile and older BlackBerry versions had memory issues if you left apps open in the background. iOS is pretty slick however with handling memory internally. Open apps will not gobble memory when left open in the background.
     
  4. Ledsteplin

    Ledsteplin Genius
    Gold

    Joined:
    Oct 29, 2013
    Likes Received:
    971
    Background apps do seem to take a lot of RAM space. But it never uses it all. The iPhone does well at managing that. It's not anything to be concerned with.
     
  5. Rafagon

    Rafagon Genius
    Gold

    Joined:
    Dec 7, 2011
    Likes Received:
    1,254
    I agree wholeheartedly with all of the above posts.

    On a related note (I realize this is not what you asked about), the only thing you may want to consider doing in order to save some battery life is go to Settings > General > Background App Refresh > and only enable it for your most precious apps. (I would assume that having Background App Refresh on for any given app would keep that app using a little bit more RAM than having it off, but this added RAM usage is likely negligible.)

    Myself, I have it completely turned off since, in my estimation, my well-being is not contingent upon any of my apps being granted background-refresh privileges:

    photo.jpg
     
  6. Rafagon

    Rafagon Genius
    Gold

    Joined:
    Dec 7, 2011
    Likes Received:
    1,254
  7. silvermoon

    silvermoon Evangelist
    Gold

    Joined:
    Jul 17, 2013
    Likes Received:
    179
    It's as though you read my mind. I was just about to ask if you should close down apps to save battery life. Do apps automatically get shut down when they are inactive?

     
  8. Napoleon PhoneApart

    Senior Moderator

    Joined:
    Jun 19, 2007
    Likes Received:
    4,463
    I think I linked to this before, but this comes from an iOS developer on reddit:

    ======================================================================================
    ======================================================================================

    I keep seeing people talking erroneously about the 'need' to kill all apps. As an iOS developer, this worries me, because it means caching, downloads, and any sort of tidying up upon standby is interrupted completely.

    I thought I'd expand to non-developers how the standby procedure works, and why nobody needs to kill all of their running apps and how it is detrimental to the functionality of the apps to kill them when exiting.

    Some of you may recognize this post. It's a cross post from comments on here earlier.

    Apple designed the multitasking system to be unobtrusive and not require the user to think about 'managing free memory' or anything, because the system is supposed to fill up as much memory as possible. Android's multitasking works fairly the same way, but with much less control by the system.

    When an app is paused, a series of calls are dispatched to the app. 'Clean up your memory.' 'Pause whatever's going on.' (It's in iOS apps as a method called applicationWillResignActive: is called, and then applicationDidEnterBackground:.)

    When the system encounters a lack of memory for a new app to open, all of the currently running apps are sent a few other messages. First, they're sent a careful message

    'Hey, I'm getting a memory warning. Could you please please remove some things from memory please?' (This is called both in the AppDelegate as applicationDidReceiveMemoryWarning: and in the currently presented view controller as didReceiveMemoryWarning, basically telling the developer to get rid of some things that can be redownloaded or cached to the disk.)


    If after that call to all running apps still hasn't freed enough, it calls all the apps, starting from the oldest, and says 'Alright, you've gotta close now. Pack up and go home.' (This is the killing process: applicationWillTerminate:)


    So closing your apps interrupts that whole incredibly calculated song and dance and can actually be detrimental to performance, as apps now need to reopen from cold every single time you open them again.

    TL;DR: You do not need to kill all of your apps, because iOS has an incredibly complicated system that relies on full-memory situations.

    EDIT 1: (from /u/binders_of_women_) "Additional TL; DR - it takes more battery to quit and restart your apps than it does to let them run in the background."

    EDIT 2: Added code highlighting.

    EDIT 3: I don't know enough about your individual situations to provide an accurate judgment but RAM may not have been 100% the biggest player there. All I can provide is the intended path for apps to follow. There are obviously use cases that contradict what I am saying, but very often people do close all apps unnecessarily.
     
    • Informative Informative x 1
    • List
  9. Europa

    Europa Moderator
    Senior Moderator

    Joined:
    Dec 12, 2008
    Likes Received:
    5,521
    Anyone who has watched a couple Keynote presentations of a new iPhones will pick up on how important battery life is to Apple. They list those specs every year. They made a task switcher that enhances the user experience without negatively impacting battery life or performance. The fact that it doesn't have an easy way to kill all apps at once is intentional...because it doesn't need to be done. It will automatically close an app if the resources are needed for another that is currently opened. Not all of the apps in the task switcher are actually running and it's a waste of time to go through and close them all out. Let the iPhone manage its own memory - it does a better job than you can.
     
  10. silvermoon

    silvermoon Evangelist
    Gold

    Joined:
    Jul 17, 2013
    Likes Received:
    179
    Thanks for that explanation Europa and Napoleon. I always was wondering if I was actually doing more harm to my phone than good by closing every single app. With that said, what are the major factors when it comes to conserving battery life?
     
  11. silvermoon

    silvermoon Evangelist
    Gold

    Joined:
    Jul 17, 2013
    Likes Received:
    179
    Also what if you are no longer using an app... Do you just let it run silently in the background? I have a habit of checking what apps are running by double pressing the home button. If I see an app I haven't used, I generally close it.
     
  12. Napoleon PhoneApart

    Senior Moderator

    Joined:
    Jun 19, 2007
    Likes Received:
    4,463
    Try and be nice to people, avoid eating fat, read a good book every now and then, get some walking in, and try and live together in peace and harmony with people of all creeds and nations.

    Oh, sorry. That was the meaning of life. My bad.
     
  13. Europa

    Europa Moderator
    Senior Moderator

    Joined:
    Dec 12, 2008
    Likes Received:
    5,521
    Yes, leave them alone. Not all of them in the task switcher are running anyway. Open up some of them that you have to scroll over to get to and you'll see that they have to fully open.
     
  14. Europa

    Europa Moderator
    Senior Moderator

    Joined:
    Dec 12, 2008
    Likes Received:
    5,521
    Turn the phone off and be sure not to use it. If you must use it, use it quickly and then turn it off again. Turn the brightness down all the way. If you don't have to squint to see it, it's too bright. Keeping it in airplane mode with WiFi off tends to help as well. :D
     
  15. MrMike6by9

    MrMike6by9 Evangelist
    Gold

    Joined:
    Nov 16, 2008
    Likes Received:
    120
    Hey Naps! Can you point me the original citation for background app behavior? I've searched Reddit this AM but must be using the wrong search term(s). I'd like to keep a copy for future reference.

    AdvTHANKSance!


    ... always be knolling ...
     
  16. Napoleon PhoneApart

    Senior Moderator

    Joined:
    Jun 19, 2007
    Likes Received:
    4,463
  17. MrMike6by9

    MrMike6by9 Evangelist
    Gold

    Joined:
    Nov 16, 2008
    Likes Received:
    120

Share This Page