有谁知道'top'命令的结果在android中的含义? [英] Does any one know the 'top' command 's result's meaning in android?

查看:15
本文介绍了有谁知道'top'命令的结果在android中的含义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现 'top' 的结果与标准 linux 中的结果不同.我在网上搜索了一下,但找不到我的答案.例如,以下是我的 android 中 top 的部分结果:

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

所以#THR 可能是线程数.但是'PCY' 是什么?我在/proc/(PID)/文件夹中找不到此信息.而且我发现如果我打开一个 youtube,PCY 将是 fg.然后如果我退出它(youtube),youtube 进程仍然存在,但 PCY 将是 bg.就S"而言,我发现所有进程始终都是S",这意味着睡眠,即使我的 youtube 应用程序当前处于活动状态.很奇怪……

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...

有人知道吗:>谢谢

推荐答案

这是我的(未经)教育的猜测:

Here's my (un)educated guesses:

PID - 进程 ID

PID - Process ID

CPU% - CPU 使用率

CPU% - CPU Usage

S - 状态(或可能的状态)R=跑步,S=睡眠

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

#THR - 线程数

PCY - 我有点难过.您似乎对它的作用有很好的了解,所以这就足够了(假设 fg 和 bg 是唯一可能的值)

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 - 启动任务的用户名

UID - Name of the user that started the task

名称 - 这个是不言自明的......

Name - This one is self-explanatory...

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

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

虚拟集大小(有时缩写为 VSZ)和驻留集大小.谷歌搜索会找到一些 Linux 的详细信息.这里是高极速版:

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 表示有多少虚拟内存与进程相关联,Resident Set Size 表示关联的物理页数随着过程.

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 在 Android 上通常没有意义.如果我内存映射一个 1MB 的文件,VSS 增长了 1MB,但我没有使用任何资源(除了条目在虚拟映射表中).

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 在 Android 上部分没有意义,因为它不能识别多个进程之间共享的页面.如果进程 A 的 RSS 为2MB,进程B的RSS为2MB,有可能有4MB占用的物理页数.也有可能只有占用了 2MB 的物理页面.

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.

就您的 Youtube 处于休眠状态而言,如果它没有主动做任何事情,它就会处于休眠状态,即使它在前台也是如此.尝试创建一个基本上是 while(1){Do something senseless} 的简单应用程序,看看它是在休眠还是在运行.当然,这也可能是 Android 处理多任务处理方式的一个怪癖.

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.


PCY 大部分是未受过教育的,有点随机的,在黑暗中刺伤 --
PCY -- 策略 -- 确定 Android 的内存管理器应如何处理应用程序
FG -- 前台 -- 进程被视为前台进程,不应被杀死以释放 mmemory
BG -- Background -- 进程被认为是后台进程(不在前台主动运行,可能会被杀死以释放内存)


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)

这篇关于有谁知道'top'命令的结果在android中的含义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆