[TECH] Android's Internal Task Killer - and the effect of modifying it (ROOT ONLY)

Discussion in 'Android Hacks and Help' started by DroidxRage, Feb 28, 2010.

  1. DroidxRage

    DroidxRage Member

    Joined:
    Nov 17, 2009
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New England - Home of Champions
    Ratings:
    +0
    I wanted to explain how Android's internal Task Killer works to help people understand how it wokrs. After I stumbled across an app, Auto Memory manager, and posted a thread asking for questions, I was pointed toward another thread with a lot of good technical information about the inner workings of Android's internal Task Killer. (thx JonKyu) Here's what I took from the 20+ pages of that thread, and I'll try to break down what I learned with the high points, and feel free to visit that thread if you want the bits and pages of it.
    How to configure Android's *internal* taskkiller - xda-developers

    And this is meant to be informative, so just as a CYA, please do what you will with this knowledge at your own risk.

    Android has a task killing system in place where it groups processes into 1 of 6 types. The type that is assigned depends on how important that process is to what the phone is actively running. Here are the 6 types that Android uses with definitions, which neatly correspond to the sliders in the Auto Memory Manager application I found.



    FOREGROUND_APP: // This is the process running the current foreground app. We'd really rather not kill it! Value set in system/rootdir/init.rc on startup.

    VISIBLE_APP: // This is a process only hosting activities that are visible to the user, so we'd prefer they don't disappear. Value set in system/rootdir/init.rc on startup.

    SECONDARY_SERVER: // This is a process holding a secondary server -- killing it will not have much of an impact as far as the user is concerned. Value set in system/rootdir/init.rc on startup.

    HIDDEN_APP: // This is a process only hosting activities that are not visible, so it can be killed without any disruption. Value set in system/rootdir/init.rc on startup.

    CONTENT_PROVIDER: // This is a process with a content provider that does not have any clients attached to it. If it did have any clients, its adjustment would be the one for the highest-priority of those processes.

    EMPTY_APP: // This is a process without anything currently running in it. Definitely the first to go! Value set in system/rootdir/init.rc on startup. This value is initalized in the constructor, careful when refering to this static variable externally.



    So what happens is when the free memory (ie: what your taskiller reports) gets below a certain predetermined value, it starts killing the least important processes off, starting with the bottom of that list. (ie: at 20MB free kill empty processes, at 15MB free kill Content Provider processes).

    For people with root, there are applications in the market that let you change the predetermined values that Android starts killing off process types. The one I used and reference in this post is Auto Memory Manager, but MinFree is another one by one of the guys over at XDA. Same idea, just a different look. The reason you might want to modify this, is to force Android to be more strict with it's application policing.

    The consensus over there, is that people are getting generally better performance, battery life, response, etc. by tweaking these values. The upside over a normal task killer, is this is something that is already running in the Android OS, so it's not adding any additional resource usage, just modifying how it already acts.

    So for example, on the app if you wanted to make it so whenever the free memory got below 70MB, it would kill off all the empty processes, in the application, you would simply drag the Empty Applications slider up to 70MB. It's just a matter of fine tuning the right mix. I would recommend not putting the top 2 or 3 values very high, as those processes are things that are actively running, and may have a user impact. Generally speaking, you want to try to play with the bottom 3, if you do touch the top 3 please understand what you're doing.

    Also, it doesn't change the values permanently, as it requires the values be reset on reboot (not built into the application at this time). But you also don't have to worry about permanent changes to the system if you decided to uninstall or anything.


    If anyone has any questions I'm sure we can all help each other out. I'm also interested to see after people start using this, what they're finding good results with as far as settings for our devices. If you find something that works particularly well for you, please feel free to post your numbers for other users to experiment.
     
  2. hookbill

    hookbill Premium Member Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    19,502
    Likes Received:
    7
    Trophy Points:
    168
    Location:
    N.E. Ohio
    Ratings:
    +7
    Going to give Auto Memory Manager a try. Right now I have hidden applications set to 50mb, content provider, 55 mb and empty application at 70 mb.

    Be interesting to see how this works as far as battery performance goes. I'd like to see other peoples settings as well.
     
  3. JonKyu

    JonKyu Silver Member

    Joined:
    Nov 16, 2009
    Messages:
    2,396
    Likes Received:
    0
    Trophy Points:
    101
    Location:
    Provo, UT
    Ratings:
    +0
    Cool you posted a thread! I don't think a lot of people know this, so I think it'll be good exposure to let more people know what these apps do and that we can actually do this lol, instead of the inefficient Taskillers!

    EDIT: Maybe it'd be cool if you posted a link to all three Memory manager so people can choose? :) Just a suggestion lol I think it might make it more complete?
     
    Last edited: Mar 1, 2010
  4. DroidxRage

    DroidxRage Member

    Joined:
    Nov 17, 2009
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New England - Home of Champions
    Ratings:
    +0
    ^^ great idea. :)

    Here is Auto Memory Manager, the app I referenced in my post:
    [​IMG]

    Here is MinFree, another choice also written by one of the guys that was working to uncover this information:
    [​IMG]

    Here is AutoKiller, another option also on the market:
    [​IMG]

    Enjoy guys! :)
     
    Last edited: Mar 1, 2010
  5. JonKyu

    JonKyu Silver Member

    Joined:
    Nov 16, 2009
    Messages:
    2,396
    Likes Received:
    0
    Trophy Points:
    101
    Location:
    Provo, UT
    Ratings:
    +0
    It's the one I mentioned in your auto memory manager thread "autokiller"
     
  6. DroidxRage

    DroidxRage Member

    Joined:
    Nov 17, 2009
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New England - Home of Champions
    Ratings:
    +0
    ahhhh, yes.... added to the above post! :)

    Also, Spare Parts has a setting for this, but it's not nearly as customizable so I chose to leave it off the list.
     
  7. JonKyu

    JonKyu Silver Member

    Joined:
    Nov 16, 2009
    Messages:
    2,396
    Likes Received:
    0
    Trophy Points:
    101
    Location:
    Provo, UT
    Ratings:
    +0
    Yeah I'm little confused with the spare parts one, don't you need root access to modify the file with the settings on it? No where on spare parts does it say it needs root access, at lear I don't think. Also don't make the mistake of using both at the same time because I think my spare parts memory settings were conflicting with auto killer and it was giving me weird readings before lol.
     
  8. Vulcan1600

    Vulcan1600 DF Super Moderator Staff Member Premium Member

    Joined:
    Nov 20, 2009
    Messages:
    5,717
    Likes Received:
    168
    Trophy Points:
    178
    Location:
    Pennsylvania
    Ratings:
    +169
    Well, you caught my attention with this. I'll install it this morning and tonight when I get home from work will give you my initial report. The worst thing in the comments for the app for Auto Memory Manager is apparently the icon is a fish lol.
     
  9. unix.punkx

    unix.punkx Silver Member

    Joined:
    Nov 13, 2009
    Messages:
    3,330
    Likes Received:
    0
    Trophy Points:
    101
    Location:
    Bloomington, IN
    Ratings:
    +0
    nice, ill also give this a try after classes and report back.
     
  10. kaboyd

    kaboyd Member

    Joined:
    Dec 17, 2009
    Messages:
    568
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Southern Indiana
    Ratings:
    +0
    Very good post. Thanks for the process explanation, I was unclear on most of that.
     
  11. DroidxRage

    DroidxRage Member

    Joined:
    Nov 17, 2009
    Messages:
    627
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    New England - Home of Champions
    Ratings:
    +0
    I was really unclear at first too, which prompted my original questions on the app... so I only thought it only right that since I understood it a little more now (thx again JonKyu), that I would try to share what I had learned since there were a few threads floating on those apps, but none that really explained it.

    Plus, once we start getting some results in from what people are using for settings, we can probably narrow down the settings that are best suited to our devices.

    And as JonKyu said, I wouldn't recommend running two of these at once... seems like a recipe for trouble since they're both altering the same set of values.
     
  12. bastosero

    bastosero Member

    Joined:
    Jan 9, 2010
    Messages:
    531
    Likes Received:
    1
    Trophy Points:
    18
    Ratings:
    +1
    Does the AutoKiller app have an automatic setting to be used when you reboot?
     
  13. mwhartman

    mwhartman Super Moderator/RS Premium Member

    Joined:
    Jan 15, 2010
    Messages:
    10,739
    Likes Received:
    12
    Trophy Points:
    153
    Location:
    South FL
    Ratings:
    +12
    This is a very interesting article. I understand the concept but I've no clue where to go to locate my settings. If you'll enlighten me on how to locate/modify, I will be glad to post.

    Mike
     
  14. jasonb

    jasonb Active Member

    Joined:
    Dec 6, 2009
    Messages:
    1,151
    Likes Received:
    0
    Trophy Points:
    36
    Ratings:
    +0
    i'm going to try autokiller.
     
  15. mikecolorama

    mikecolorama Member

    Joined:
    Nov 23, 2009
    Messages:
    459
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Valinda, CA
    Ratings:
    +0
    since i didn't know how to set it on my own, i used the setting that you posted and i have noticed much better battery life today. i'm still at 70 percent. normally, with the same use, i would be at 50. i don't know how it works, but i like it.:)
     
Search tags for this page

android internal task killer

,
how to configure android task killer
,
internal android task killer
,
internal task killer on s4
,
internal task killer s4
,
modify system internal memory task-killer
,
s4 internal task killer
,
samsung s4 root hack app task killer
,
task killer tweak android
,
the effects of an auto task killer