Slashdot Mirror


Public Service Announcement: You Should Not Force Quit Apps on iOS (daringfireball.net)

John Gruber, writing for DaringFireball: The single biggest misconception about iOS is that it's good digital hygiene to force quit apps that you aren't using. The idea is that apps in the background are locking up unnecessary RAM and consuming unnecessary CPU cycles, thus hurting performance and wasting battery life. That's not how iOS works. The iOS system is designed so that none of the above justifications for force quitting are true. Apps in the background are effectively "frozen", severely limiting what they can do in the background and freeing up the RAM they were using. iOS is really, really good at this. It is so good at this that unfreezing a frozen app takes up way less CPU (and energy) than relaunching an app that had been force quit. Not only does force quitting your apps not help, it actually hurts. Your battery life will be worse and it will take much longer to switch apps if you force quit apps in the background. [...] In fact, apps frozen in the background on iOS unfreeze so quickly that I think it actually helps perpetuate the myth that you should force quit them: if you're worried that background apps are draining your battery and you see how quickly they load from the background, it's a reasonable assumption to believe that they never stopped running. But they do. They really do get frozen, the RAM they were using really does get reclaimed by the system, and they really do unfreeze and come back to life that quickly.

37 of 285 comments (clear)

  1. Baloney by Anonymous Coward · · Score: 4, Insightful

    Baloney. I have heard this argument so many times from OS developers. What does "effectively frozen" and "severely limited" mean? They are either frozen or they aren't. If they aren't frozen then they are taking up resources.

    1. Re:Baloney by jafiwam · · Score: 5, Informative

      Or so they say

      In practice, people who didn't know how to quit apps had shitty battery life... which stopped when they started closing apps.

      Maybe newer iOS versions are better, however it has been very obvious through experimentation that closing apps helps performance.

    2. Re:Baloney by Quirkz · · Score: 5, Interesting

      5 or so years ago, it was definitely clear that leaving apps open was causing battery drain, and I obsessively closed everything as soon as I was done.

      About a year ago I heard someone from Apple suggest it wasn't necessary any longer, and for the most part I leave things up and it seems to be true that they're not tremendous battery hogs.

      Except Google Maps, of course. That burns through something like 1% of my battery every minute, and definitely keeps working even in the background. I will look stuff up, kill it, and repeat as necessary many times over rather than leaving it open any longer than I need to.

    3. Re:Baloney by aergern · · Score: 4, Informative

      You can turn this behavior off in the settings so it will not continue running and using GPS when not in the foreground. So check the settings and be free! :D

      --
      Tell me what you believe...I'll tell you what you should see.
    4. Re:Baloney by SirSlud · · Score: 2

      As phones became more powerful, applications were using more battery. So people were all over the manual ways to preserve battery life. Software development on the relatively new phone OSes matured, and thus was able to move on to tackle "later" generation features like power-saving and efficiency (and the hardware became more efficient too, like the BT and GPS chipsets.)

      Users usually lag behind stuff like this, and end up with habits of things they used to have to do long after the problem has been largely addressed in software optimization and feature work.

      --
      "Old man yells at systemd"
    5. Re:Baloney by Incadenza · · Score: 3, Insightful
      Because you are not receiving 'a GPS signal'. You are receiving a multitude of GPS and GLONASS signals. From the time stamps and positional information encoded in these signals you then have to calculate your position. All these calculations are time-critical, so I guess they don't combine very well with power saving features.

      Why there have beeen tremendous amounts in rendering speeds and all kinds of image processing, but not in the calculation of these GPS coordinates, that is a mystery to me as well.

    6. Re:Baloney by IcyWolfy · · Score: 4, Informative

      Because:
      1. it needs to power a separate radio to receive the GPS signals.
      2. GPS sends out almanac data (rough position information) and ephemeris data (orbital information)
      3. Your device needs to calculate the tragetory and position, and lock on to 4 satellites (3 for psotion, 1 for time) using this data
      4. You device then needs to calcutate the total time-delta, to the nanosecond, between the time each satellite sends a message, and when you receive it.
      5. ** Using this time delta, you can calculate your exact distance to each satellite.
      6. Solve three overlapping sphere equations to triangulate your position at the ground.
      7. Solve another equations using 4 satellites to calculate the equivalent atomic clock time.

      Your device is processing dozens of messages per second, to keep the locks on each GPS satellite, to switch active satellites as you move out of view of any given satellite, and to keep your calculated position, and delta position (speed) all in sync.

      It's very computationally expensive, and thus takes power to operate the chipset doing all this work.
      In addition, if you're in a city, without clear line-of-sight to enough satellites, it can boost the power and try to make sense of fainter data, or try harder to calculate which satellites are in theory overhead, and then to obtain a lock on each satellite and it's orbital trajectory and speed. Net result: GPS uses more battery in cities than in countryside.

       

    7. Re:Baloney by tlhIngan · · Score: 2

      Baloney. I have heard this argument so many times from OS developers. What does "effectively frozen" and "severely limited" mean? They are either frozen or they aren't. If they aren't frozen then they are taking up resources.

      Apple has a few categories of apps that don't completely freeze up - e.g., apps that are VoIP related, audio related, location related. For these apps, iOS will let them run a background thread so they can continue to listen for calls (or handle the current call in progress), continue to play music, or continue to get GPS location information so they can update your position.

      These apps don't freeze by default (though you can force iOS to freeze them even if they do this), since it's expected that you'd want your VoIP app / music player / map app to keep going even when it's not in the foreground. But just because they don't freeze completely doesn't mean the OS can't freeze the other threads that handle the UI, for example, and reclaim those resources.

      And by severely limited, only those apps in thsoe categories can be backgrounded and still run. All other apps will be frozen.

    8. Re:Baloney by Solandri · · Score: 2

      IIRC (this was the explanation I got back when iOS couldn't multi-task), a non-multi-tasked app in iOS put into the background has its memory state saved, and the app is dumped from RAM just as if you'd closed it. When you "switch back" to the app, the app is actually restarted and the memory state restored. That is how Apple faked multi-tasking without actually multi-tasking. The app is "frozen" in that it can't do anything because it's actually removed from RAM (except for its memory state, which depending on the app could be smaller or bigger than the app).

      Android's model is to keep background apps in RAM until it runs out of RAM. Then it (originally) starts sending a kill command to the app which hasn't been used in the longest time. I believe they've changed the kill sequence, as the original sequence encouraged apps to be battery hogs and needlessly do stuff in the background to keep themselves from being killed first. When an app receives the kill command, it's up to the app to clean itself up, save its state if needed, and shut down gracefully.

      A user-commanded force close kills the app without giving it the chance to do all this cleanup, and can result in lost data or state. I would imagine the same is true for iOS.

    9. Re:Baloney by PIBM · · Score: 5, Insightful

      My old hand held gps could run over 60 hours tracking my position, recording it along with the precision, number of satellites used to receive it, and some other data to my SD card, sometime displaying the local map and my recent track, all while only using 2 1.5V 1600mAh batteries, using 12 years old technology. iPhones & android devices GPS positionning is much less precise than this old device, and use much more power. WTH.

    10. Re:Baloney by phantomfive · · Score: 2

      It would be nice if the article had some benchmarks and graphs. The only benchmark the linked to (that I saw) was a benchmark for startup times between iOS and a Galaxy.

      No data, no point.

      --
      "First they came for the slanderers and i said nothing."
    11. Re:Baloney by Carewolf · · Score: 2

      It still is. It only makes no difference on the majority of apps, but a few apps are allowed to do things in the background and are very battery costly to not close. How are people supposed to know which apps are effectively frozen and which are hogs?

    12. Re:Baloney by Darinbob · · Score: 4, Insightful

      The purpose to kill the apps may not be to save battery life, but to limit spying.

    13. Re:Baloney by ShanghaiBill · · Score: 2

      Nothing to do with the iPhone.

      Indeed. I have a Samsung Galaxy V, and it sucks power when the GPS is on. I only turn on GPS with I am actively using the map app.

    14. Re:Baloney by fnj · · Score: 4, Informative

      Utter bullshit. A GlobalTop FGPMMOPA6H standalone complete GPS module (as used in, e.g., the Adafruit Ultimate GPS breakout) draws 25 mA at 3.3 v during acquisition, and 20 mA at 3.3 v while tracking. And it does all those same things you list. "Very computationally expensive", my ass. All the analog and digital stuff is run off a single tiny MediaTek chip MT3339, which includes a radio and an ARM7EJ-S core. The processor clock runs at no more than 98 MHz.

      If you have a 2000 mAh battery, it ought to run the entire GPS load, minus display mapping, for 100 hours. You shouldn't be able to detect any effect at all in "minutes".

    15. Re:Baloney by jmauro · · Score: 4, Informative

      The calculations aren't processor intensive, they're really quite easy. The battery drain is from the radio receivers, which are amped up to distinguish the really weak GPS signal from all the noise with the really small antennas built into the phone.

    16. Re:Baloney by garote · · Score: 3, Interesting

      You would be imagining incorrectly then.

      iOS has not had to "fake" multi-tasking for quite a few versions now. Why base your imaginings on that?

      iOS now selectively freezes applications on a per-thread basis, depending on the services identified as being handled by each thread, and orders the app to save state preparatory to being potentially killed shortly after is has been backgrounded in the UI. This effectively makes most apps flash-frozen in RAM, and all apps instantly killable on-demand if memory pressure demands it.

      Going into the app switcher and "killing" them just wastes your time, and your device's battery, sending deallocation commands to things that are only there because the RAM hasn't been requested for anything else yet, or even worse, just loading the saved thumbnail images of the last seen state of an app that has ALREADY been deallocated (eating up some of your RAM as it does so) so you can flick your thumb upward on them and remove them from the list. There is honestly no point to this exercise except to indulge your OCD.

      The real savings is in the designated threads for designated services: They are policed. A thread that is allowed to continue running in order to keep playing you music, for example, is actually disallowed from claiming more than a certain percentage of CPU time, and disallowed from accessing certain frameworks.

      That said, some applications try to abuse this. A few versions and iOS updates back, there was a furor over the way Facebook behaved when it was backgrounded. It actually spun up a fake "music" thread, playing dead silence, and used it to fetch more network data than it was otherwise allowed, which in turn drained battery faster.

      If you suspect there are apps doing nefarious crap like this, go to settings > general > usage > battery and look at the statistics. The culprit in your declining battery will be shown right there. If you want you can hit a few switches and deny that app all background activity.

    17. Re:Baloney by tender-matser · · Score: 2

      Because you are not receiving 'a GPS signal'. You are receiving a multitude of GPS and GLONASS signals. From the time stamps and positional information encoded in these signals you then have to calculate your position.

      Those calculations couldn't be that expensive. Besides, they're probably mostly hardware accelerated.

      With the cellular + wifi radios turned off ("aircraft mode") and the gps radio turned on (with a gps tracking app collecting all nmea data and gzip-compressing it into a file) AND occasional use of a mapping map (written with OpenLayers in javascript and pulling data from a local http server), my cheap chinese phone is able to hold a charge for ~2days.

      I've never used an iPhone, but it's probably the google maps app which is doing something seriously fucked up (track and collect info about cellular towers and wifi hotspots and send it to google?).

  2. Why do they care? by Train0987 · · Score: 2, Insightful

    If iOS is designed so well then why in the hell should it matter if a user force-q1uits everything only to re-open it later? This makes me suspicious that they don't want you turning off certain things.

    1. Re:Why do they care? by TFlan91 · · Score: 4, Insightful

      It's not saying they don't want you to. It is saying that the reason you are doing it, may not be as valid as you might expect.

    2. Re:Why do they care? by 93+Escort+Wagon · · Score: 3, Interesting

      In my experience, iOS' "Low Power Mode" works extremely well in terms of extending a phone's remaining battery life. Of course, one of the things it does is stop the background execution of most apps.

      --
      #DeleteChrome
    3. Re:Why do they care? by Anonymous Coward · · Score: 2, Interesting

      Force quit is there because sometimes you need to do it.

      The OS is good, but it's not magic. It can't always tell if an app somebody else coded is in an inconsistent or errored state.

      There's a lot of uninformed computer voodoo that users buy in to. One of them is that force quiting background apps is a good idea. If there's any real benefit it's in their head.

      iOS is /really/ good at suspending apps. I've had apps keep their state /between iOS upgrades/ - Exited a game, and came back to it weeks later after a major iOS release. Picked up exactly where it left off.

    4. Re:Why do they care? by R3d+M3rcury · · Score: 4, Insightful

      If you're killing apps to save battery life, you're probably right--it's not making much of a difference.

      If you're killing apps because they insist that they need to know where you are--even when they are not the foreground app--then it's certainly making a difference.

    5. Re:Why do they care? by BasilBrush · · Score: 2

      Just set permissions. Every app that uses GPS has an entry in the system settings/privacy/location services list. The options are Always/While-using/Never.

      There is no reason to quit apps in the backgroud.

  3. Where's Task Manager for iOS? by Jeremi · · Score: 2, Funny

    I was going to press control-alt-delete to bring it up, but I couldn't figure out how to plug in a keyboard... ;)

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  4. Distinctly untrue, despite the hype by kaka.mala.vachva · · Score: 5, Interesting

    I have an iphone 6s, and I see the location icon come on when I check the weather (using the native app), because it is set to reporting local weather. Mostly, it goes away in a bit - but I have seen the icon stay on many times even when I have moved away from the weather app. I have to manually kill the weather app to make the location tracking go away.

    1. Re:Distinctly untrue, despite the hype by 93+Escort+Wagon · · Score: 4, Informative

      This is the number one reason I force quite an apps. A bunch of location-using apps I use must be force-quit in order for them to stop using my location.

      Go to Settings -> General -> Background App Refresh and disallow any applications which you don't want to let run in the background... which is probably most of them.

      It's a bit irritating that, for most apps, running in the background is enabled by default. There are very few which really need to do that.

      Oh, and you may need to occasionally do that again. I've seen all those toggles get re-enabled after certain updates.

      --
      #DeleteChrome
    2. Re:Distinctly untrue, despite the hype by JaredOfEuropa · · Score: 3, Interesting

      Disclaimer: I develop iOS stuff for fun (and sometimes make some money doing it).
      Sometimes an app doesn't seem to be suspended completely and parts of it keep running. A few years ago the Facebook app was notorious for this: if you didn't force-quit the app it would often suck the battery dry in a couple of hours. This would happen sometimes even with apps that were not designed to run in the background, i.e. track your location or keep an ear out for certain events. But those few cases aside, the guy is right: in almost all cases it makes no sense force-quitting an app; just going back to the home screen will make it suspend all activity. And over the years iOS has gotten a bit better at suspending apps.

      App developers have to do very little to make this happen: threads are stopped automatically after a while, the app gets notified so that it can wrap up stuff and save the device state, free up memory if possible, and so on. And even if you don't free up that memory like a good little boy, the phone will do it for you... pretty much by force-quiting your app when needed. Not ideal, but as a developer you have the choice of either releasing memory or just let the app die when the phone needs it.

      --
      If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
  5. Whatever.... by __aaclcg7560 · · Score: 2

    I turned off background refresh on 90% of the apps that I use on my iPhone 6s to conserve bandwidth (2GB monthly cap) and battery life. Very few apps need real time updates. The rest can wait for updates until I'm ready to deal with them on my home wireless network.

  6. Why can't the user have control? by jma05 · · Score: 4, Insightful

    I use an Android phone. Aside from some small, personal apps I wrote for myself a while ago, I am not really an app developer and don't have an in-depth understanding of the issues.

    But my annoyance is this: there are apps that I only use once a month and others not even that. I definitely don't need them running in any form, even with the lightest footprint and some of them are consuming power. They keep coming back the instant I killed them. Why do the modern OS vendors assume they know best? I would like to have control over the execution policy, not the app developer. In Windows, I could remove entries from the startup, task scheduler etc. In Unix, I have full control. Why can't I do that in modern operating systems? Yes, I am aware there are startup editors in Android. I found them unreliable or inadequate.

    I as the user, have much better context information on how my apps need to run. Sure, people can shoot themselves in the foot, but provide a means to restore defaults when custom configurations aren't working, but don't take away control altogether.

    Every commercial app developer wants his app to be ready to go. In Windows that meant far too many developers would add their apps to system startup. With enough such entries, it made a large proportion of consumer machines to go sluggish by swapping and many systems were upgraded just because the users did not know how to clean up their startup items. Sure, the modern systems prevent all that, but that does not mean I should not have any control. The lesson here is that developers cannot be trusted to be respectful of shared system resources (and so the OS takes over more control), not that the users cannot be trusted. At least, let the apps be better controlled in developer mode. It took what 5 or 6 versions before Google started allowing users to rescind permissions? I want more permissions (and with better granularity) to rescind.

    Well, that was my rant. If I missed any obvious solutions, enlighten me.

    1. Re:Why can't the user have control? by BasilBrush · · Score: 4, Insightful

      This is about iPhones, not Androids. They work completely differently as regards background apps.

  7. Measure it by ricky_charlet · · Score: 4, Interesting

    settings->battery. Scroll to bottom for a report of how much battery each app has used. View it as last 24 hours, or as last 7 days. and FYI, (for me) Apple Mail, when connected to a corporate exchange server, sucks battery in the background. 30% overnight iphone 6s IOS 10.3

  8. Re:The struggle for battler life is real. by BasilBrush · · Score: 2

    Gruber has owned and I believe still owns, every generation of iPhone.

    He just hasn't fallen for the placebo that you have. There really is no benefit to routinely killing background apps. It's pure ignorance of how iOS works.

  9. That's what they all say by WaffleMonster · · Score: 3, Informative

    The same basic advice has been peddled and widely ignored by end users who know better across all major mobile platforms. The reality is this is only true for apps don't take advantage of facilities to sidestep background execution restrictions.

    Many app intentionally seek to run continuously in the background to enable persistent stalking and download ads as these activities yield profits for app vendors. It should go without saying facilities exist across all major platforms to accommodate.

    https://developer.apple.com/li...

  10. Absolute garbage advice by superdave80 · · Score: 2

    Back when I got my first iPhone (4), started trying out all of the apps it came with, and downloading a few new ones. After about a week or two, I noticed that the battery wasn't lasting as long. This is when I discovered how to view all of the apps that were still... frozen?... in the background. There were dozens of these. I force quit them all, made sure to force quit when I was done with an app, and the battery life went back to normal.

    A few years later, I started using some workout apps that time rests and breaks in my routine. I usually used these at night before bed. Over time, I noticed that if I ever left these apps open, the battery would be dead or near dead the next morning, even if the battery was full when I went to sleep.

    Apple needs to stop tell us that those background apps don't need to be closed, because they sound like idiots every time they say it.

  11. More to the point.. Tracking.. by thesupraman · · Score: 2

    The reason we keep being told 'dont force close you apps' is that if you do, they cannot continue to do 'their thing' quietly in the background.
    Their thing is often reporting things back to their developers - your position, actions, etc, etc..

    THAT is why every now and then they remind us how foolish we would be not to keep them running.

  12. That's a lot of extrapolation there. by garote · · Score: 3, Insightful

    "Dozens of calculations per second" hasn't been considered computationally expensive for about _40_years_.

    The iPhone 7 contains a motion coprocessor chip that performs these calculations and tens of thousands more every second, using a vanishingly small amount of power. Positional data from wifi networks, cell towers, GPS, GLONASS, the compass, and the inertial sensors inside the phone is combined when and where available automatically. What isn't needed is powered down.

    Even if getting accurate GPS data is harder in cities, it is irrelevant, given that cities contain way more cell towers and way more wifi networks, and the iPhone knows its position from those automatically in the course of normal operation without even needing to query GPS. ... which it does anyway because the power involved is, again, miniscule. Seriously: If the phone can detect three cell towers - practically a given in any good-sized city - it knows where it is just by being a phone. Ten years ago cell towers didn't provide the necessary positional and timing information for this to be so. Now they almost always do.

    Let's all have some more humility here. Knowing something about GPS does not make us experts in the design of the most bleeding-edge mass communications tool on the planet, and/or the networks that drive it.