Does any one know the 'top' command 's result's meaning in android?

后端 未结 4 655
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 07:17

I have found the result of \'top\' is different from result of in standard linux.I have searched on the web a little bit but I can not find my answer. For example, following is

相关标签:
4条回答
  • 2021-02-05 07:48

    top sourcecode [ top sourcecode][1]

    [1]: http://androidxref.com/4.0.4/xref/system/core/toolbox/top.c#442 to get the complete logic of how each value is calculated

    0 讨论(0)
  • 2021-02-05 07:52

    Try man top on any normal linux / unix (though I don't think Android has man installed by default).

    Actually now I look it looks like those column titles aren't mentioned on that man page, but the point stands that man is usually the best place to start looking for information about linux / unix commands.

    0 讨论(0)
  • 2021-02-05 07:58

    this page says what VSS and RSS mean, but does not specify how to obtain the more meaningful PSS and USS

    0 讨论(0)
  • 2021-02-05 08:04

    Here's my (un)educated guesses:

    PID - Process ID

    CPU% - CPU Usage

    S - State (or possibly status) R=Running, S=Sleeping

    #THR - Number of threads

    PCY - I'm kinda stumped here. You seem to have a pretty good grasp of what it does, so that's good enough (assuming that fg and bg are the only possible values)

    UID - Name of the user that started the task

    Name - This one is self-explanatory...

    VSS and RSS: From http://groups.google.com/group/android-beginners/browse_thread/thread/e6f2d396a68238ad?pli=1

    Virtual Set Size (sometimes abbreviated VSZ) and Resident Set Size. Googling will turn up some detailed info for Linux. Here's the high speed version:

    VSS indicates how much virtual memory is associated with the process, Resident Set Size indicates how many physical pages are associated with the process.

    VSS is generally meaningless on Android. If I memory-map a 1MB file, VSS grows by 1MB, but I haven't used any resources (other than entries in a virtual mapping table).

    RSS is partially meaningless on Android, because it doesn't identify pages shared between multiple processes. If process A has an RSS of 2MB, and process B has an RSS of 2MB, it's possible that there are 4MB of physical pages occupied. It's also possible that there are only 2MB of physical pages occupied.

    EDIT: As far as your Youtube is sleeping deal, if it isn't actively doing anything, it will be sleeping, even if it is in the foreground. Try creating a simple app that is basically while(1){Do something meaningless} and see if it is sleeping or running. Granted it also might be a quirk with the way that Android handles multitasking.

    EDIT2:
    Mostly-uneducated-somewhat-random-stab-in-the-dark for PCY --
    PCY -- Policy -- Determines how an app should be treated by Android's memory manager
    FG -- Foreground -- Process is considered a foreground process and should not be killed to free mmemory
    BG -- Background -- Process is considered a background process (not actively running in foreground and may be killed to free memory)

    0 讨论(0)
提交回复
热议问题