1. DroidForums.net is currently undergoing a major software upgrade. If you are experiencing any problems logging in please: Contact Us

[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
    Offline

    DroidxRage New Member

    Joined:
    Nov 17, 2009
    Messages:
    628
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New England - Home of Champions
    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
    Offline

    hookbill Premium Member Premium Member

    Joined:
    Nov 30, 2009
    Messages:
    19,545
    Likes Received:
    5
    Trophy Points:
    0
    Location:
    N.E. Ohio
    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
    Offline

    JonKyu New Member

    Joined:
    Nov 16, 2009
    Messages:
    2,398
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Provo, UT
    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
    Offline

    DroidxRage New Member

    Joined:
    Nov 17, 2009
    Messages:
    628
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New England - Home of Champions
    ^^ 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
    Offline

    JonKyu New Member

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

    DroidxRage New Member

    Joined:
    Nov 17, 2009
    Messages:
    628
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New England - Home of Champions
    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
    Offline

    JonKyu New Member

    Joined:
    Nov 16, 2009
    Messages:
    2,398
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Provo, UT
    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
    Offline

    Vulcan1600 Super Moderator Staff Member Premium Member

    Joined:
    Nov 20, 2009
    Messages:
    5,693
    Likes Received:
    142
    Trophy Points:
    63
    Location:
    Pennsylvania
    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
    Offline

    unix.punkx New Member

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

    kaboyd New Member

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

    DroidxRage New Member

    Joined:
    Nov 17, 2009
    Messages:
    628
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    New England - Home of Champions
    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
    Offline

    bastosero New Member

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

    mwhartman Super Moderator/RS Premium Member

    Joined:
    Jan 15, 2010
    Messages:
    10,739
    Likes Received:
    12
    Trophy Points:
    38
    Location:
    South FL
    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
    Offline

    jasonb New Member

    Joined:
    Dec 6, 2009
    Messages:
    1,153
    Likes Received:
    0
    Trophy Points:
    0
    i'm going to try autokiller.
  15. mikecolorama
    Offline

    mikecolorama New Member

    Joined:
    Nov 23, 2009
    Messages:
    459
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Valinda, CA
    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.:)
  16. JonKyu
    Offline

    JonKyu New Member

    Joined:
    Nov 16, 2009
    Messages:
    2,398
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Provo, UT
    It has the option re-do your settings after a reboot, if that what you mean? lol Also it has preset shortcuts that you can put on your desktop for fast access lol
  17. mwhartman
    Offline

    mwhartman Super Moderator/RS Premium Member

    Joined:
    Jan 15, 2010
    Messages:
    10,739
    Likes Received:
    12
    Trophy Points:
    38
    Location:
    South FL
    Guy's I apologize for my earlier response. I misread Hook's comment. I mistakenly thought that there was already some setting on the phone that allowed one to modify. Duh!

    I just downloaded Auto Memory Manager. In addition to the hidden, content, and empty settings one can change foreground, visible, and secondary settings.

    What are most of you setting the last three to?

    Mike
  18. mikecolorama
    Offline

    mikecolorama New Member

    Joined:
    Nov 23, 2009
    Messages:
    459
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Valinda, CA
    Any updates?
  19. jmilljr24
    Offline

    jmilljr24 New Member

    Joined:
    Apr 3, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Ive been using autokiller. It has built in presets you can choose from and i've only used the "optimum" setting so far.

    Hidded apps - 40mb
    content provder - 50 mb
    Empty apps - 60m

    Good so far. Might try something a little more aggressive in a few days
  20. Droidlicous
    Offline

    Droidlicous New Member

    Joined:
    Nov 6, 2009
    Messages:
    244
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Indianapolis, IN
    This is what I set mine too! its late at night and my phone will be on the charger soon, so I will give an update tomorrow evening!
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
,
system internal memory task-killer
,
task killer tweak android
,
the effects of an auto task killer