View Single Post
  #1 (permalink)  
Old 05-28-2010, 01:40 PM
bast525's Avatar
bast525
Regular 'Geeker
Offline
Location: Chesapeake, VA
 
Join Date: Dec 2007
Posts: 329
Reputation: 460
bast525 is becoming a PPCGeeks regularbast525 is becoming a PPCGeeks regularbast525 is becoming a PPCGeeks regularbast525 is becoming a PPCGeeks regularbast525 is becoming a PPCGeeks regular
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Another look at Android memory management, and why task killers are not bad

Let me start this by saying that I, like many here, came over from Windows Mobile (Touch Pro 2 most recently), and so, had a definite WinMo mindset when it came to RAM usage and leaving apps running in the background. I read through various forum posts and only got confused by the two sides of the argument, which pretty much boiled down to:

"Task killers are bad! Why? Because they kill tasks! Android/Linux don't work like Windows/WinMo, you don't need to kill tasks." Ok... well... this doesn't really tell me WHY it's bad.... if anything, just why it may not be NECESSARY.

Other side of the argument:

"Task killers keep my phone from running slow and give me way more battery life!" Hmmm... sounds good, but this is really subjective, hard to measure and hard to prove, and not everyone will see the same results. Or can we?

I decided to try an experiment, and see how my phone behaved with some 'torture testing'. Mind you, I don't know jack about Linux or Android other than what I've learned the last month since buying an Incredible. I, like many, installed Advanced Task Killer as one of my very first apps, coming to Android with that WinMo mindset, that things should be closed when not in use.

At any rate, here are some things I have tried, found, and learned:

- If you are going to use ATK, use it wisely, in other words, make sure you add certain apps to the Ignore List. This should include core system apps such as Gmail, messaging, clock, things that give notifications. Also, some third party apps such as Astrid, Pandora, Profile changers, etc. Don't just go closing all processes to get the most RAM possible as this WILL cause problems.

- Even if I kill off non core/system apps (the apps on my Ignore List) on a regular basis, I find that over time, my free RAM becomes less and less. After a reboot I have over 200 MB free, but after a few days, this will dip down below 100, even after killing off everything but the ignored apps.

- I decided to try an experiment. I started opening apps, one at a time, leaving them all open, and then checking the free RAM. With each app I opened, the free RAM went down, until there was about 35 MB free. At this point, no matter how many additional apps I opened and left open, RAM never went below about 30 MB. So, as has been stated on those other threads, Android WILL free up resources from other apps to make available as new apps are opened. You can never use up ALL of the RAM. So... ATK not necessary, right? Read on...

- However, when my phone got to this point, I found that performance DID suffer, NOTICEABLY. Opening new apps, or moving around in an app, was definitely less speedy or responsive. Was this due to load on the CPU? I don't think so. I do believe that a process uses little or no CPU time when it is idle or not in the foreground, which seems to be confirmed from what I could tell by using the app Spare Parts (a highly recommended app for people who want to know what resources and battery life an app is using). My best guess is that the choppiness is due to extra time Android has to spend freeing up and re-allocating RAM from one app to another. I don't know for sure, but what I do know, is if I have enough apps open, and I notice my phone start to run slowly or choppy, I open ATK and always find that my RAM is at that 'critical' point, around 35 MB. Close out some apps, and now my phone is running butter smooth again. Subjective, right? Maybe so, but easily enough duplicated for any of you anti-task killer people out there or anyone else... open up every app on your phone, and tell me you don't notice a hit in performance, even though most of those apps are just 'idling' in the background....

- But still, no matter how much I stay on top of closing out apps, my free RAM keeps getting lower over time... usually below 100 MB after 3 days even after killing off all non-core apps. I didn't want to have to reboot every few days to get that RAM back, and even though Android will re-allocate resources as talked about previously, when I get below 100 MB, I am that much closer to the 'critical' point, and can have that many few apps open before the phone starts to act slowly. So... how to get RAM back to post-reboot levels? Is this a 'memory leak'? It seems that even when apps are closed, some apps still leave things behind in RAM, much like they can in WinMo.... well, what was a good way to FORCE WinMo to clean out this junk RAM? PUT IT IN PANIC MODE!

- So, what I did was open a TON of apps, almost every app I have, all at once. Again, once I got past 10 apps or so, ATK showed RAM staying right around 35 MB, and the phone was running pretty slowly, but I kept going. Once I had opened up about 30 apps, I then used ATK to kill them ALL off, minus the core ignored system apps of course. BINGO! Free RAM now showed to be a much nicer 180 MB free, almost what I would have after a reboot. NICE!

- Lastly, about battery life... I haven't done any scientific testing to prove one way or the other, but all I can say is this: my understanding of the way RAM works, physically, is that power must be used to hold things in RAM. Battery power. So, the more data is held in RAM, the more battery power must be used to hold it there. Now, I don't know if Linux somehow changes the rules here, but I know that this understanding was never taught to me to be OS specific. So, as far as I know and am concerned, more free RAM is a good thing, not only because it keeps you away from that critical level where Android has to pause to free resources for you, but also, it should mean less battery drain. Is it enough to be a noticeable difference? I have no idea... who knows how much juice it takes to keep 1 MB of data in RAM. But, ANY additional battery life is good IMO.

Anyways... these are just some observations from a non-technical, non-Linux-knowing perspective. I hope they help some of you out, I definitely feel I have a better understanding of RAM management on my phone now. And I WILL be keeping ATK installed and using it as needed.

Oh, and lastly, there will be those who argue that even if all of the above is true, ATK is STILL not necessary, why not just use the Settings - Applications menu to kill them off? Sure, you could do that, if you like to spend about 5x more time doing something than is necessary.... bottom line, ATK does the same thing, only way faster and more conveniently. Works for me
Reply With Quote
This post has been thanked 5 times.