android procrank

Android procrank  (/system/xbin/procrank) 工具,能够列出进程所占用的内存使用情况。顺序为从高到低。

每个进程占用内存大小以 VSS,  RSS , PSS, USS 的形式列出。

为了简化描述,内存占用以页为单位表述,而不是字节。 通常每页为 4096 字节。

 

VSS ( 等同于 ps 命令列出的 VSZ) 是单个进程全部可访问的地址空间。

其大小包括可能还尚未在内存中驻留的部分。比如地址空间已经被 malloc 分配,但是还没有实际写入。

对于确定单个进程实际内存使用大小, VSS 用处不大。

 

RSS  是单个进程实际占用的内存大小。

RSS 易被误导的原因在于, 它包括了该进程所使用的所有共享库的全部内存大小。对于单个共享库, 尽管无论多少个进程使用,

实际该共享库只会被装入内存一次。

对于单个进程的内存使用大小, RSS  不是一个精确的描述。

 

PSS 不同于RSS,它只是按比例包含其所使用的共享库大小。

例如, 三个进程使用同一个占用 30 内存页的共享库。 对于三个进程中的任何一个,PSS 将只包括 10 个内存页。

PSS 是一个非常有用的数字,因为系统中全部进程以整体的方式被统计, 对于系统中的整体内存使用是一个很好的描述。

如果一个进程被终止, 其PSS 中所使用的共享库大小将会重新按比例分配给剩下的仍在运行并且仍在使用该共享库的进程。

此种计算方式有轻微的误差,因为当某个进程中止的时候, PSS 没有精确的表示被返还给整个系统的内存大小。

 

USS 是单个进程的全部私有内存大小。亦即全部被该进程独占的内存大小。

USS 是一个非常非常有用的数字, 因为它揭示了运行一个特定进程的真实的内存增量大小。

如果进程被终止, USS 就是实际被返还给系统的内存大小。

USS 是针对某个进程开始有可疑内存泄露的情况,进行检测的最佳数字。

 

[cpp]  view plain  copy
 print ?
  1. Usage: procrank [ -W ] [ -v | -r | -p | -u | -h ]  
  2.     -v  Sort by VSS.  
  3.     -r  Sort by RSS.  
  4.     -p  Sort by PSS.  
  5.     -u  Sort by USS.  
  6.         (Default sort order is PSS.)  
  7.     -R  Reverse sort order (default is descending).  
  8.     -w  Display statistics for working set only.  
  9.     -W  Reset working set of all processes.  
  10.     -h  Display this help screen.  


 

[cpp]  view plain  copy
 print ?
  1. 1|root@android:/ # procrank  
  2. procrank  
  3.   PID      Vss      Rss      Pss      Uss  cmdline  
  4.  1780   48188K   36892K   21177K   18196K  system_server  
  5.  1953   44944K   36056K   17201K   14904K  com.android.systemui  
  6.  2109   51300K   34888K   15291K   12840K  com.android.launcher  
  7.  2248   32996K   32948K   14184K   12516K  com.tencent.qqpimsecure  
  8.  2913   29880K   29796K   11980K    9612K  android.process.acore  
  9.  1396   36280K   36168K   11762K    7552K  zygote  
  10.  2058   27200K   27132K   10204K    9120K  com.android.phone  
  11.  2352   26028K   25960K    9680K    8740K  com.wandoujia.phoenix2  
  12.  2670   25388K   25312K    8064K    6332K  com.sina.weibo  
  13.  2029   22276K   22204K    6700K    6040K  android.process.media  
  14.  2866   23504K   23428K    6161K    4424K  com.sina.weibo.servant  
  15.  2632   21700K   21624K    6071K    5384K  com.infinit.wostore.ui  
  16.  1398    8904K    8904K    5948K    5012K  /system/bin/mediaserver  
  17.  2484   21580K   21508K    5679K    4892K  com.android.email  
  18.  2704   20512K   20436K    5601K    4936K  com.tmall.wireless:core  
  19.  2399   20384K   20300K    4990K    4248K  com.android.contacts  
  20.  2746   20720K   20660K    4973K    4188K  com.android.browser  
  21.  2090   20376K   20320K    4805K    4084K  com.android.nfc  
  22.  2043   20516K   20448K    4753K    4012K  com.android.inputmethod.pinyin  
  23.  2200   20272K   20196K    4679K    3868K  com.android.settings  
  24.  2563   20028K   19952K    4492K    3640K  com.android.mms  
  25.  2788   19304K   19232K    4123K    3396K  com.android.calendar  
  26.  2436   19812K   19744K    4119K    3520K  com.android.providers.calendar  
  27.  2505   18724K   18648K    3973K    3460K  com.android.exchange  
  28.  2655   19588K   19516K    3972K    3320K  com.android.dazhihui  
  29.  2465   19816K   19736K    3894K    3160K  com.android.deskclock  
  30.  2233   18756K   18684K    3467K    2824K  com.android.music  
  31.  2605   17540K   17460K    2824K    2264K  com.android.SystemLog  
  32.  2157   17376K   17296K    2683K    2088K  com.android.location.fused  
  33.  2193   17156K   17076K    2663K    2124K  com.android.smspush  
  34.  2590   17364K   17280K    2662K    2092K  com.broadcom.phone.register  
  35.  2943   17112K   17036K    2653K    2056K  com.android.musicfx  
  36.  2619   17132K   17056K    2620K    2040K  com.android.voicedialer  
  37.  2073   17020K   16940K    2603K    1980K  com.broadcom.bt.app.fm  
  38.  2421   17132K   17056K    2530K    1976K  com.broadcom.app.autoupdate  
  39.  1395   33216K    3888K    1859K    1520K  /system/bin/surfaceflinger  
  40.  1394    6544K    3472K    1737K    1468K  /system/bin/rild  
  41.  1403    3216K    3212K    1673K    1524K  /system/bin/glgps  
  42.  2962    1660K    1660K    1413K    1408K  procrank  
  43.  1397    3200K    3200K    1133K     788K  /system/bin/drmserver  
  44.  2148    1604K    1604K     812K     792K  /system/bin/wpa_supplicant  
  45.  1392    1312K    1312K     514K     448K  /system/bin/netd  
  46.  1390    1176K    1176K     418K     360K  /system/bin/vold  
  47.  1400     892K     892K     295K     280K  /system/bin/keystore  
  48.  1450     532K     532K     258K     252K  /system/bin/sdcard  
  49.  1449     228K     228K     208K     208K  /sbin/adbd  
  50.  1408    3572K     500K     199K     172K  /system/bin/bkmgrd  
  51.     1     264K     264K     190K     144K  /init  
  52.  1401     536K     536K     176K     164K  /system/bin/akmdfs  
  53.  1405     444K     444K     169K     160K  /system/bin/usb_portd  
  54.  2905     480K     480K     160K     120K  /system/bin/sh  
  55.  1399     440K     440K     154K     148K  /system/bin/installd  
  56.  2387     392K     392K     149K     144K  uuids_sys  
  57.  1437     464K     464K     148K     108K  /system/bin/sh  
  58.  1393     424K     424K     143K     136K  /system/bin/debuggerd  
  59.  1023     184K     184K     130K      84K  /sbin/ueventd  
  60.  2287     440K     440K     124K      88K  sh  
  61.  2290     440K     440K     124K      88K  sh  
  62.  1389     336K     336K     109K     104K  /system/bin/servicemanager  
  63.  1406     360K     360K     106K     100K  /system/bin/atxd_proxy  
  64.  2289     340K     340K     105K     100K  /data/data/com.tencent.qqpimsecure/files/athena_v2.dat  
  65.                           ------   ------  ------  
  66.                          241715K  201748K  TOTAL  
  67.   
  68. RAM: 475520K total, 10412K free, 8104K buffers, 190720K cached, 244K shmem, 27252K slab  
  69. root@android:/ #  

http://blog.csdn.net/cfy_phonex/article/details/9365983
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值