The provided answers are accurate, I just want to clarify from an iOS developer’s point of view.
iOS is designed to manage as many things as possible so you (and developers) don’t have to worry about them. The end result is a somewhat consistent approach across applications, including those from Apple (even tho sometimes Apple itself cuts some corners).
That being said, the premise is:
- iOS knows more about memory than us. It knows how much it has, and how much it needs (to a certain degree).
- iOS has full control over the memory; it has the final word on who uses what.
- If iOS needs memory, it will find it, and this is usually done by killing other processes that have been idle for some time (and there are many rules behind the scenes, we don’t know them all, and we don’t really worry about them).
- Everything a Processor (CPU) does, takes energy. Absolutely everything. Don’t forget computers are just very tiny electron containers that move them around in very tiny spaces.
- When an app is killed, there are some agreed protocols (contracts) that define what needs to be done. iOS enforces and carries these protocols. But work must be done, it’s not free and certainly not always cheap (it really depends on what the App is).
Having said all that, one assumes most users close apps in the hopes to increase battery life, under the impression that, by closing things, then less energy is wasted in maintaining these apps running.
The truth is that, on iOS, this is almost never the case. When you press home, the app is suspended and it no longer uses resources that other app may need. If a new app (or even iOS) needs that memory, it will take care of it by itself, but only if it needs.
You closing the apps over and over, are forcing iOS to make that potentially expensive task of really unloading an app, saving its state and what not, with the added problem that when you re-open the app, all that stuff has to be reverted and, depending upon the complexity of the app, a lot of things must be read from the storage, up into the main memory of the phone, and so forth. All this extra work, could have been avoided if you simply let the app stay in its “suspended” state.
In some instances (and they are rare but not impossibly rare), you want to kill apps that are misbehaving. Examples are (but not limited to): Apps that deal with background audio, or asynchronous services like location (where the app asks for a location and iOS must go and ask around where it is, for example, by firing the GPS if needed), video streaming, etc.
I’ve had countless instances of apps like Lyft, United Airlines, even Twitter, that end up in a broken state (or simply don’t properly work), either because you’re in a bad network (iOS has gotten really bad at recovering from some bad networks in the past 3-4 releases) or the network simply doesn’t properly respond.
In time, most of these problems tend to go away and the app starts working again; but if you really need the app to work now, then you have to go ahead and pay the price of having to kill it and restart it from scratch. You used more battery by doing that, but, hey, you needed it.
And if this was confusing, I can give you a car analogy, because that’s what we tend to do all the time.
The Car Analogy
I know that car technology has advanced and this is no longer a good example, but play with me here.
Firing a Car’s engine used to use more fuel than just idling. When cars had carburetors instead of injectors, this was even worse; that’s why turning your engine off when you stop at a red light, can theoretically use more fuel than just idling for a minute. Newer cars have a much more efficient mechanism and can stop the engine, but stay in a semi-started state (let’s not get too into cars here).
You closing apps, is the equivalent of a person turning the car off at every stop light. As opposed to just letting it idle until you need it again, normally a few seconds later.
The analogy is not perfect, for the truth is, idle cars still use fuel, whereas suspended apps don’t; however, In the eyes of the phone, they are not using anything memory/battery related (as long as they don’t have background processing of any sort active, obviously).
You’re basically turning your engine off every time you kill an app, and you’re not letting the iOS “smart” mechanism of idling your engine take care of it, so when the light turns green, you can simply press the accelerator and the engine is running faster than if it would have been 100% stopped. Starting an engine from a stopped state, also uses more power than just fuel, you need to turn the starter so the engine can be cranked, fuel injected and sparks created, so… it’s a lot of work behind the scenes. Apps are like engines. :)