What is the best task killer app for Android?

What is the best task killer app for Android? Well, the answer is none of them. Sure there are some nice apps out there for killing tasks, but the fact is you just don’t need one with Android.

To clear things up about this, Google’s Android developers blog has finally put this debate to rest about why a task killer is unnecessary, as well as why there are certain services that run in the background all the time, I’m sure at one time or another you’ve seen them and asked yourself  “Why do those services keep starting after I kill them?”. Below you can read about when applications stop.

When does an android application “stop”?

A common misunderstanding about Android multitasking is the difference between a process and an application. In Android these are not tightly coupled entities: applications may seem present to the user without an actual process currently running the app; multiple applications may share processes, or one application may make use of multiple processes depending on its needs; the process(es) of an application may be kept around by Android even when that application is not actively doing something.

The fact that you can see an application’s process “running” does not mean the application is running or doing anything. It may simply be there because Android needed it at some point, and has decided that it would be best to keep it around in case it needs it again. Likewise, you may leave an application for a little bit and return to it from where you left off, and during that time Android may have needed to get rid of the process for other things.

A key to how Android handles applications in this way is that processes don’t shut down cleanly. When the user leaves an application, its process is kept around in the background, allowing it to continue working (for example downloading web pages) if needed, and come immediately to the foreground if the user returns to it. If a device never runs out of memory, then Android will keep all of these processes around, truly leaving all applications “running” all of the time.

Of course, there is a limited amount of memory, and to accommodate this Android must decide when to get rid of processes that are not needed. This leads to Android’s process lifecycle, the rules it uses to decide how important each process is and thus the next one that should be dropped. These rules are based on both how important a process is for the user’s current experience, as well as how long it has been since the process was last needed by the user.

Once Android determines that it needs to remove a process, it does this brutally, simply force-killing it. The kernel can then immediately reclaim all resources needed by the process, without relying on that application being well written and responsive to a polite request to exit. Allowing the kernel to immediately reclaim application resources makes it a lot easier to avoid serious out of memory situations.

If a user later returns to an application that’s been killed, Android needs a way to re-launch it in the same state as it was last seen, to preserve the “all applications are running all of the time” experience. This is done by keeping track of the parts of the application the user is aware of (the Activities), and re-starting them with information about the last state they were seen in. This last state is generated each time the user leaves that part of the application, not when it is killed, so that the kernel can later freely kill it without depending on the application to respond correctly at that point.

In some ways, Android’s process management can be seen as a form of swap space: application processes represent a certain amount of in-use memory; when memory is low, some processes can be killed (swapped out); when those processes are needed again, they can be re-started from their last saved state (swapped in).

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

5 Responses to “What is the best task killer app for Android?”

commenter

Vansi. Its a good post to understand the intricacies of Multi Tasking in a Mobile Architecture.
I have a query on this. Does the Application need to store the session state when it expected a force kill or Android OS takes care of storing the session state and return back to the original state when the user re-opens the App?

How far this is different from Hibernate feature in the Desktop Systems.

in iOS, the Application get a signal when something goes wrong and the Application need to get prepared to cache and store the current session state so it can be used when re-opening the app again

Thanks
Nirmal

commenter

Hello Sir,
By default Android OS takes care of saving the state of the application when it goes to background. But when the app is killed by some task killer application or Android OS(for recovering memory) then the application needs to save the state of the screen. If an app always saves the state of the screen then it becomes helpful for the Android OS to resume the state of the application even if the app is killed and launched again.

Hibernate feature saves the state of the applications before turning off the system. In Android , the OS defaultly does this feature for all the apps that are sent to background by user(if an app is run and suddenly home button is pressed on the phone then the app goes to the background with an idle state).

commenter

Good one Vansi. If you can provide the source of this write up it will helpful to validate all these. Consider this case

I am on my way to delhi by sea. I load the ship and i remember i have not brought my charger for mobile. Now i want to just stop all process to conserve my battery, so that i don’t want to take any chances until i reach delhi… i need the killer??

Thanks

Murugan Ramu

commenter

Question by Murugan Sir:: “I am on my way to delhi by sea. I load the ship and i remember i have not brought my charger for mobile. Now i want to just stop all process to conserve my battery, so that i don’t want to take any chances until i reach delhi… i need the killer??”

Answer :: In this case if an app is able to show the running services in the device and provides an ability to stop them, then the device will conserve the battery usage. If the app is providing a screen to kill the running applications then the application related services will also be killed. In my opinion the ability to stop the running services are enough to conserve battery life. Since the applications which are not running in the foreground are always in an idle state. Their screen state will be saved by the OS to revoke at a later stage when the user launches the application. Hence the applications and its services look united but still they are different. The way in which an application run in its own process and lifecycle, similarly application’s services(started by the application) too run in its own process and lifecycle.

Conclusion :: An ability to stop the running services are enough to conserve battery life.

Leave a Reply:

You must be logged in to post a comment.