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

android, command, linux

Solution

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)

Problem

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 the partial result of top in my android: ``` PID CPU% S #THR VSS RSS PCY UID Name 814 2% R 1 940K 372K fg root top 110 1% S 58 185000K 59216K fg system system_server 31 0% S 1 0K 0K fg root vsync_workqueue 49 0% S 1 0K 0K fg root file-storage 52 0% S 1 0K 0K fg root gp2a_wq 178 0% S 9 98476K 23820K fg system com.android.systemui ``` So #THR probably is the number of threads.But what is 'PCY'? I can not find this information in the /proc/(PID)/ folder. And I have found that if I open an youtube, the PCY will be fg. Then if I quit it(youtube), the youtube process still exists but the PCY will be bg. And in terms of 'S', I have found all processes are always 'S' which means sleeping, even my youtube app is currently active. It's weired... Does anyone have any clue:> Thx

Original source