Inside Android

Ed. note: Sorry for the problem, everybody. The column's now here in its entirety.

Hey everybody. This week lets talk about the thorn in Android's side – efficient task management.

Before we get started, yes I'm one of those people who will say “Stop using the task killer” as a first response to some weird questions. Lots of other pretty knowledgeable folks will say the same thing. They (we) are right. Task killer applications tend to cause a lot of problems simply because using them properly can be a bit confusing, especially with all the conflicting information out there. Follow us after the break and let's figure this out once and for all.

A few days ago we had a front page post with Android Central Editors' application picks. Our Editor-in-Chief Dieter Bohn picked TasKiller Pro.  Of course the second or third reply in the comments was quick to point out that task killers “screw up the phone.” This just reinforced my thought that we really need to discuss this together, and let each person decide their needs rather than bash task killers as a whole.

Android's Memory management 

Android was designed to be a multitasking, fire-breathing beast. It allows applications to keep their spot in device RAM, and stay ready to jump back into focus when the user needs them. The OS also is very good at sharing libraries between applications, so that app coders have a great set of functions already built to choose from. In a perfect world (perfect for developers anyway) we all would use the same applications for the same reasons and that would be the end of it.

But nothing's perfect

We all use different apps, at different times, in different ways. When you consider that nightmare for developers, it's surprising that Android (or any mobile operating system) handles the job as well as it does. Let's take a quick and hopefully easy to understand look at what goes on behind that screen.

An application starts, either because you started it or the developer sees a benefit in having it run behind the scenes. Some examples of the last bit -

  • When you add or remove an application, Google Voice starts (if it was not running). It scans the application to see if needs to use or share any functions with it. Install a new text-to-speech engine? Google Voice will use it.
  • Copy some pictures from your SD card to your computer? The gallery needs to start up when you remount your SD card to check for new pictures or videos so it can scan them and have them ready to show in the right spot.

This all sounds great. What we aren't considering above is that these apps will stay in the device memory until they are told to close. They won't use any other resources, just sit idle and be ready to re-draw themselves on your screen. In today's age of 1Ghz+ processors and high speed data transfer, we get impatient when we want to load a NEW application and it's not instant. We want our device to zoom between screens. We want our device to snap new applications into focus. We want our device to perform in ways it wasn't really designed to do. Using a task killer the correct way can get close to those goals.

A quick study here on just how Android manages memory - Each application has a number (from 1-6) assigned to it, depending of the type of app and it's state. Android assigns a level of minimum free RAM for each category and kills off what it thinks is no longer needed in each once that threshold is reached. This is a pretty technical discussion, and I'm just going to mention it here for those that are interested. If you would like to manipulate these numbers yourself, feel free to give me a holler and I'll point you in the right direction. But let's not clutter up this any more than necessary, as this is a pretty advanced discussion.

The task killer interface

Each application looks and acts a little different, and task killers are no exception. I'll be using Advanced Task Manager for my examples. I am not recommending this above any others. It suits my needs and was well worth the $0.99, so I stopped looking for alternatives. Your choice could look a bit different, but should have the same functionality. Just have a look through the settings and you'll find where to make the same changes and choices.

Below you're looking at a list of running application that the task killer has permission to kill once you give it the go-ahead. You're not seeing every running process, and reading a little further will explain why that's a good thing.  We'll refer back to this image in a bit, but take a second and look over it for now.

Manually killing tasks

The best easiest least complicated way to use a task killer is to open it and manually kill off things you're sure you don't need whenever you feel things have slowed down. The trick is knowing what else won't work if you kill off an app. Things like games, web browsers, dictionaries or other stand alone apps are usually a safe bet to kill off if you find them running. In the example above Astro File Manager is running because I was looking for a file I had downloaded. I'm done with Astro, so there is no need for it to stay running. I could safely kill it off, and nothing else would be affected.

Note – It's a popular misconception that using the back button to exit an application will close it and remove it from memory. This is only true if the app was coded to work this way. Some will, some won't. This is not a universal standard in Android. It doesn't hurt anything, but it's a lot of work to close some apps this way. Entirely your call. I use the Home button because I'm just too lazy to hit back enough times to see my homescreen :)  I'm mentioning it here because Astro is one of those apps that will eventually kill itself if you back up enough times.

You can't see it in my screenshot above, but the Market is also running. I haven't opened the Market in a while, but I'm not going to kill it off. Why? Because if I do, then notification of updates for my installed Market apps won't come in. There are many apps that need to stay alive to use all of their features. You'll have to do a bit of thinking before you decide if you can just kill off an app. Here's a general idea of what to think about:

  • Apps that remind you of something – I use Astrid to help me remember tasks and deadlines. Astrid can fire off a notification to remind me when events are coming up. If I kill it off, I won't get any reminders.  Then I get lost in my computer and nothing ever gets done.
  • Apps that look for updates - In the previous example, I left the Market running so it can notify me of any application updates. Any apps that periodically look for outside data need to stay alive if you want them to find any of that data.
  • Apps that are still doing something – In my example Connectbot is running. I happen to have an active connection to a server in the garage that I'm updating. I can quickly switch over and see the progress as well as issue the commands right from my phone. If I kill it off, I'll have to reopen and connect again each time.

AutoKilling 

Task managers usually come with a function to periodically kill off apps. This is where things get dangerous. Thankfully, most also come with some sort of whitelist of apps that do not get killed during this auto-killfest. While some common sense is still needed, some apps will always need to be on this list

  • Any application that has the manufacturer or carriers name in it should never be killed.
  • Any application that has the word android. (yes the period is there on purpose) should never be killed.
  • Any application that keeps time should never be killed.
  • Any application that has a widget that updates should never be killed.
  • Any application that is not installed on /data (this is where user apps go) should never be killed.
  • If you can't figure out exactly what an application is, it should never be killed.
  • Home replacements, whether from the Market or your manufacturer never should be killed. This also means Sense, Blur, and Touchwiz. They also have dependencies that should stay alive, refer to numbers 1, 5 and 6 above. Of course if you're a tinkerer, and know which parts of the system you don't need running on your particular installation, feel free to experiment.  And share your results. 

This narrows things down quite a bit. Mark all your games to be killed. Mark all your “stand alone apps” (things like Astro in the example above) to be killed. Mark the things you need occasionally, but do not want to run behind the scenes to be killed. Read through what's left, and see if it fits into any of the above categories. If it does, mark it to never be killed.  Remember to consider things like ConnectBot in my example.  I don't want it to run all the time, but while I'm using it I'd like it to stay alive in the background, so I will mark it to NOT be autokilled by the task manager.  Of course, you'll have to set the task killer itself so it stays alive.

If your task killer has a setting to determine how often to kill off apps, set it to do so as often as possible. I don't see any sense in having the task killer running and not using it, as this the reason for using one in the first place.

Once that's done, hit the Home button and ignore everything for a while. Use the phone as you normally would, but pay attention if something starts not working as it used to. If things start to get out of whack, have a look at your whitelist and be sure the app in question isn't set to be killed off.   I will say right off the bat – don't ever kill your clock if you want to use the alarm, last minute seats on a plane because you missed your flight are much more expensive than ones purchased through your ticket agent a week ahead of time. :)

One last thing to keep in mind – When/if you have issues with your device and are seeking help, be sure to mention that you're using a task killer and how you're using it. “Help with alarm on Cliq – using ATK but not killing clock” is a great example of this. You'll still get replies telling you to stop using task killers, but you also might get something useful. Letting people know that you're using a task killer but are aware of the “correct” use will weed out some of the negativity.  Also, using nice descriptive thread titles will always help out our forum moderators and make things easy to search for the next person who has the same issues.

A special section here for the rooted/ROM'd/Mad Scientist types

There's a new breed of task killer out there in the wilds of the Market. These adjust the lowmemorykiller kernel parameters and let things run as usual rather than have the user (that's me and you) try to manage each and every application. It makes sense once you consider that the code for the lowmemorykiller and it's settings haven't been changed since Android 1.0 . If you're willing to take the time to adjust the settings according to your needs, these work great. It's also very easy to pass these settings to the system without an application by writing specific values to the system settings. If this interests you (and if you're a tweeker it should!) it would be a great subject for a thread in the hacking forums, and one that I'd love to participate in.  Yeah that's a hint :)

Until next time,

Jerry

 

Reader comments

How to properly set up and use a task killer (Oh, yes, I went there!)

46 Comments

Great post. Just in case some people don't know and may search the wrong thing, the app just underneath the "The task killer interface" heading is supposed to say "Advanced Task Manager", not "Advanced Talk Manager" :)

what do you know, i've been using a task killer exactly how you're supposed to without any sort of guidance. I call it "common sense", if you don't have it, then don't use a task killer. if you're fine with your android phone without a task killer, just don't use one.

I am currently on an original bbstorm and am most likely going to upgrade to the n1 once it is released to Verizon. From reading this post am I to assume there is not a native way to kill apps on the android platform without purchasing a third party "task killer" app ?

Thanks for the response, it is pretty amazing to me that they (google) left a native task manager out of the android platform, especially since it is so heavy into multi-tasking. Even bb has a native way to kill the apps that you don't want running in the background (without having to look at things you shouldn't be shutting down). I hope they address the problem in the near future.

You're welcome!
I believe it's because android is supposed to shut down applications automatically when memory is low, just as it's written above. Now this is a nice concept but it doesn't work all the time. Maybe in the future they'll tune up the memory manager algorithm or include a built-in manager, who knows?

Those of us who come from BlackBerry are just not used to the idea that a phone would kill processes and are used to having to do so ourselves, and get confused when so many Android apps don't have close or end menu options.

The fact that the system knows to shut down processes is a great one but I think there would be a lot fewer people using task managers like this if Google/App Developers would include that feature in more stand alone apps.

I am somewhat new to the Moto Droid, but I do not yet see a way to kill apps within Android. Obviously, there are numerous 3rd-p apps out there - many have free versions. In fact I am using one of those right now with no complaints. Hope that helps a little...

Thanks again to both Foxman and Annon. Good to know the ins and outs of a software before you buy. I will probably go ahead with the n1 and hope Google decides to add a native feature to let you close apps.

Android is built on the Linux memory management model. The OS has an internal task killer running at all times that frees space as needed without user intervention.

The biggest issue is that this code was written in 2008 and hasn't kept up with the rest of the OS. While the phone still functions as designed, and multitasks very well, we (users) are spoiled. We want the OS to perform just as fast after opening all of our needed apps as it did at first boot.

The speed of the OS does not really change, but more priority is given to the home functions when you remove running programs from RAM. The device logs will show this - wait time for a new app to load is the same, but you're waiting at a different screen and it seems faster.

To make this happen, you have two choices. Reconfigure the internal task killer, or use a third party solution. Since we all are spoiled, we're going to do one of these even if it's not recommended. So we might as well try to do it right :)

Yes, a little bit of common sense and some thinking before hitting that kill button can take you a whole lot further than imminent "phone-screwed-up-ness". :) I myself prefer to use Astro's task killer tool, but only if my phone really slows down when I opened a lot of apps in quick succession. Generally my Hero behaves herself and runs quite smooth - I just love to micro-manage every app that runs in the background for low system load - but then again, sometimes an app clogs the works, or freezes and just won't force close...

Menu -> Settings -> Applications -> Manage Applications

Click an application (you get the full list of installed applications, so you have to know what you want to kill), then scroll down to find the Force Stop button.

Yes, it's unwieldy, but task killing is in fact built into Android.

I just tried that...
On one hand, you are right, that actually works. On the other hand, just loading the Manage Applications screen took me more than a minute! Granted, I have a lot of apps installed, but still. And it also lists every single installed app on your phone, including the ones that you never see, but are parts of the system.
Working? Yes.
Useful? Not really, but it's there.
Quick? Forget it...

And I think Force Stop is not exactly the preferred way to stop a sleeping app. A malfunctioning one, maybe...

So basically what I got out of this article is we really don't need a Task killer. The Verizon manger that sold me the Moto Droid said it was a must have application and he even put it on my phone. I hardly even use it but I do open it and check it once in a while. Now I am thinking about deleting advance task killer.

Anyone else feel the same or is everyone pretty much keeping their Task Killers?

If you're not obsessive with the amount of time it takes to swipe between screens or open new apps, then you don't need one.

When you get sucked in and start to worry about it (like the rest of us are :) ) you just might.

So basically what I got out of this article is we really don't need a Task killer. The Verizon manger that sold me the Moto Droid said it was a must have application and he even put it on my phone. I hardly even use it but I do open it and check it once in a while. Now I am thinking about deleting advance task killer.

Anyone else feel the same or is everyone pretty much keeping their Task Killers?

Alas....first you run many apps at a time...and then you develop a task killer app...and then you explain how to use a task killer app efficiently....???

Just buy an iPhone !!!

No thanks I have one, barely use it anymore. I like to do more than one thing at a time thank you and Steve Jobs does not think I deserve to.

I'm thinking maybe you left this one in the "common sense" catagory, but if you are using a POP or IMAP email client besides Gmail, NEVER KILL IT. If you do, you will never get notified of new email again. (I keep hoping for improvements in the native email app, like ACTUALLY emptying the Trash folder.) I installed a task killer because I heard I "needed" one; rarely use it. About all I use it for is killing the browser quickly. (And as far as never killing a carrier app, do I REALLY need Tmo's Green Perks running in the background? I think not. Let it look for updated deals when I start it. I only installed it to enter the damn contest.)

So just not using one is cool too? I had it and decided that I didn't see an appreciable difference. So I stopped using one...

Thanks for the eye opening post. The only app that bothers me with this is amazonMP3 store app mainly because I've never used it yet it seems to think I constantly need it open (or at least idle 'waiting' for me to try it, just in case). Maybe I'll spare it from a 'killing' next time.

This was a wonderful write-up, and major kudos to Jerry for writing something that helps Android neophytes and pros alike.

My question involves task killers and apps that are designed to automatically start up when you turn on/reset your phone. I've had a Nexus One for a month now, and I have apps that I've downloaded because I want to play around with them soon, or ones I have around for the occasional times I need them (shopping apps and the like). Some of these apps that I never use will open themselves upon startup.

So, is there an appreciable effect on the phone's performance when a lot of apps start up automatically? Are some of these stand-alone apps OK to kill upon startup, or are they best left alone and managed by the phone?

As an example, I just did a soft reset of my N1. The following apps were opened, are really never used, and I'd probably think to kill using my own best "common sense" (or lack thereof): Photoshop.com Mobile, Craiglist, ShopSavvy, eBay (official), Amazon MP3 Store, Google Shopper. Also, additional Twitter apps, as I decide my preference. Do these cause much of an effect on performance?

Oh, and also... does anyone know why Maps shows up twice in Automatic Task Killer sometimes? I'm pretty sure the Goog just gave me one...

Oh, I should probably also add that Advanced Task Killer has Twidroid shown as running twice too... what's going on?

If I had to guess I would say that one is the app itself and one is the background process that listens for new tweets and notifies you when they occur. Which is which I have no idea as I don't use that app.

I've observed this same behavior on the Behold II, and kill unnecessary apps 10 minutes after a reboot. There is no reason for some apps (like Documents to go) to be running.

Unfortunately, SAMSUNG put in a process that will restart certain apps like Video Player automatically. (I don't have videos on my phone, so why do I need it running.)

I was having all sorts of problems with my Droid crashing, being sluggish, and doing random reboots. That is, until I stopped using task killers.

When you go to manage applications, you can hit menu to filter the list. You can filter by 3rd party, or running apps. That makes finding the app you want much quicker.

I've never used a task killer and never saw a reason to use one. Currently I'm rooted running bb v7 (2.1) and it's blazingly fast as is. Obviously 2.1 has been optimized for better memory management because I can run tons of apps simultaneously with no noticeable degradation in performance.

I thought the reason one needs a task killer is to avoid battery drain. I had no speed problems with my Moto Droid, but added a task killer so I could get through then day on a charge.

@BrianDH -

Alot of, well, crap is a good word gets started up when the phone boots. I'll use AmazonMp3 for an example. When the systme boots, it scans the SC card. I'll bet anytime the SD card gets scanned, Amazon Mp3 wants to start up to see the results. Some apps I've seen start at boot time but can never figure out why, but i assume there's a reason.

The good part - These apps do whatever they need to do at boot time, and if that's all they need they just stop. I call those apps "ghosts". Android is just fine with letting them be ghosts, as long as something else doesn't need the memory. Ghosts are the first thing Android kills off when it decides it wants to free up some RAM, either because another process wants to run or the threshold of free memory has been reached. In the meantime, they just sit idle in RAM, not doing anything or using any resources other than the RAM that would be empty instead. It's really a great way to manage it, because it takes MORE resources to remove it from memory than it does to just let it sit.

But - when the RAM AmazonMp3 is using would be needed for another process, it does take longer to kill it off nicely and then start the other process than it would if the ram was free to start with. Not much longer, but it takes away the "snap" factor of the OS because the new process has to wait before it starts drawing itself on the screen.

Amazon in RAM - Android has to close it properly, then allocate the RAM needed by let's say the browser, then load the browser and draw it.

RAM is empty - The Browser can start drawing itself as soon as you press the icon, but it still takes a second to get up and started.

The difference is small, but understandably we would rather have Amazon closed and the Browser start running right away.

Hope that made some sense, had a long night of couchburning and whisky swilling to celebrate the Big East championship win lol.

@Humph1022 -
Apps that sit in the RAM but are ghost processes (above) don't use any other resources. It DOES take a bit to close them so another app can start, but you are using those resources when you close them anyway. There's a good chance any battery life increase is a result of you monitoring everything the phone does and killing off things that would try to start other processes (Maps starts when 4square starts, things of that nature.) Keep 4square killed and maps wont start up even though you didn't specifically try to kill Maps.

In short - task managers aren't a bad thing for battery life either as long as they are used with a bit of common sense, and you seem to have witnessed that yourself :) Thanks for the comment

I have a Sprint phone... and i use a task killer religiously... i also dont want Sprint Navigation, Amazon MP3, Bejeweled Demo, stupid built in sprint apps running when i reboot my phone.... no funn and it slows down like crazy

a look at an app called Force Close Button. Adds a said button to the notification bar which acts literally like a close button for every app.

Thanks for this. I use Advanced Task Killer Free. I DO NOT just kill off everything. But I like to know what's running. With all the Task Killers mess up your phone threads, I was wondering when it would start messing up mine. Common sense... That's a great way to put it.

Does having the Sense UI help or hurt this process?

I am converting from Iphone to Incredible and admittedly have a lot to learn about android (enough reason to spend hours on this site...)

will there be a point soon after getting the phone where i am saying to myself, "ok I need to do something about this slow speed"

thanks guys

This is an amazing post. Thanks so much for the information. I have posted a link to this in HTC community forums as well to aid the desperate!!! LOL. I would be more interested in more detailed information if so inclined to post. Also you may want to repost this once a month or so for new users. Maybe put a link in the Week in Review. Something like that.

Saying that task killers “screw up the phone.” is a bad choice of words. They may be able to impact the operation somewhat, but that is a strong choice of words and leads the uninformed to believe that it can physically harm the hardware of the phone or permanently alter the software.

Assuming the task killer has a white list of apps that it can't kill, killing all other apps can inconvenience user and thats about it.

+1 for all the kudos on this article. I've been reading message boards for 2 months now about the task killer apps and people's opinions of them- this is the first good authoritative article I've seen.

A suggestion: revisit this topic once 2.2 is in wide release, with edits and / or more applicable specifics on the effect of task killers as pertains to...

- the corporate UIs (Sense, Blur, etc.)
- the effect on the 1ghz+ processors vis a vis task killers (are they necessary anymore with the efficiency improvements in Froyo?)
- most importantly, the (admittedly, perceived as mileage will vary) effect on battery life?

I'd love to do something like this myself but alas, you guys have all the review units... :-)

Thanks again!

I learned the hard way about killing apps indiscriminately. I started having problems with the stock Android clock on my DInc. It would not play the first alarm of the morning (my wake up alarm!) It wasn't until after I had already spent money on an after-market clock, that I discovered that the stock clock's alarm (or any other alarm) doesn't work when you kill off your apps the last act of the night--before bedtime! When morning comes, your alarm clock isn't asleep--it's dead!

Why is it that AT&T has AT&T Navigator start up on the Captivate when you turn on the phone? This is not a free app. Are they trying to trick us into using it to collect an extra $10 a month? This is the main reason I user a task killer. Is there a way to keep it from starting without using a task killer?

Now I know why my alarm doesn't go off. I usually kill all apps except my Fancy Widget. Now my clock will not be killed.

Very informative. Thanks!