Home | History | Annotate | Download | only in debug
      1 page.title=Viewing RAM Usage Data (procstats)
      2 @jd:body
      3 
      4 <!--
      5     Copyright 2015 The Android Open Source Project
      6 
      7     Licensed under the Apache License, Version 2.0 (the "License");
      8     you may not use this file except in compliance with the License.
      9     You may obtain a copy of the License at
     10 
     11         http://www.apache.org/licenses/LICENSE-2.0
     12 
     13     Unless required by applicable law or agreed to in writing, software
     14     distributed under the License is distributed on an "AS IS" BASIS,
     15     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16     See the License for the specific language governing permissions and
     17     limitations under the License.
     18 -->
     19 <div id="qv-wrapper">
     20   <div id="qv">
     21     <h2>In this document</h2>
     22     <ol id="auto-toc"></ol>
     23   </div>
     24 </div>
     25 
     26 <p>The <code>procstats</code> tool is used to analyze application memory usage over time (versus at a
     27 particular snapshot in time, like <code>meminfo</code>). Its state dump displays statistics about every applications runtime,
     28 proportional set size (PSS) and unique set size (USS).</p>
     29 
     30 <h2 id=input>Input</h2>
     31 
     32 
     33 <p>To get application memory usage stats for the last three hours, in
     34 human-readable form, run the following command:</p>
     35 
     36 <pre class=prettyprint>
     37 $ adb shell dumpsys procstats --hours 3
     38 </pre>
     39 
     40 
     41 
     42 <h2 id=output>Output</h2>
     43 
     44 
     45 <p>As can be seen in the example below, percentages display what percentage of
     46 time the application was running, while the numbers following show PSS and USS
     47 as minPSS-avgPSS-maxPSS/minUSS-avgUSS-maxUSS over samples.</p>
     48 
     49 <pre class="no-pretty-print">
     50 AGGREGATED OVER LAST 3 HOURS:
     51   * com.android.systemui / u0a20 / v22:
     52            TOTAL: 100% (109MB-126MB-159MB/108MB-125MB-157MB over 18)
     53       Persistent: 100% (109MB-126MB-159MB/108MB-125MB-157MB over 18)
     54   * com.android.nfc / 1027 / v22:
     55            TOTAL: 100% (17MB-17MB-17MB/16MB-16MB-16MB over 18)
     56       Persistent: 100% (17MB-17MB-17MB/16MB-16MB-16MB over 18)
     57   * android.process.acore / u0a4 / v22:
     58            TOTAL: 100% (14MB-15MB-15MB/14MB-14MB-14MB over 20)
     59           Imp Fg: 100% (14MB-15MB-15MB/14MB-14MB-14MB over 20)
     60   * com.google.android.inputmethod.latin / u0a56 / v21483:
     61            TOTAL: 100% (57MB-59MB-59MB/56MB-58MB-58MB over 19)
     62           Imp Fg: 100% (57MB-59MB-59MB/56MB-58MB-58MB over 19)
     63   * com.redbend.vdmc / 1001 / v1:
     64            TOTAL: 100% (9.5MB-9.6MB-9.7MB/8.8MB-8.9MB-9.0MB over 18)
     65       Persistent: 100% (9.5MB-9.6MB-9.7MB/8.8MB-8.9MB-9.0MB over 18)
     66   * com.android.phone / 1001 / v22:
     67            TOTAL: 100% (19MB-22MB-27MB/18MB-21MB-26MB over 18)
     68       Persistent: 100% (19MB-22MB-27MB/18MB-21MB-26MB over 18)
     69   * com.google.android.gms.persistent / u0a8 / v7319438:
     70            TOTAL: 100% (32MB-35MB-40MB/30MB-33MB-37MB over 19)
     71           Imp Fg: 100% (32MB-35MB-40MB/30MB-33MB-37MB over 19)
     72   * com.android.bluetooth / 1002 / v22:
     73            TOTAL: 100% (9.3MB-9.7MB-10MB/8.5MB-8.9MB-9.2MB over 19)
     74           Imp Fg: 100% (9.3MB-9.7MB-10MB/8.5MB-8.9MB-9.2MB over 19)
     75   * com.google.android.googlequicksearchbox:interactor / u0a22 / v300404573:
     76            TOTAL: 100% (3.4MB-3.5MB-3.6MB/2.8MB-2.8MB-2.8MB over 19)
     77           Imp Fg: 100% (3.4MB-3.5MB-3.6MB/2.8MB-2.8MB-2.8MB over 19)
     78   * com.google.process.gapps / u0a8 / v7306438:
     79            TOTAL: 100% (23MB-24MB-28MB/21MB-22MB-26MB over 19)
     80           Imp Fg: 100% (23MB-24MB-28MB/21MB-22MB-26MB over 19)
     81   * com.vito.lux / u0a84 / v237:
     82            TOTAL: 100% (32MB-48MB-83MB/31MB-47MB-82MB over 134)
     83           Imp Fg: 100% (32MB-48MB-83MB/31MB-47MB-82MB over 134)
     84          Service: 0.05%
     85   * system / 1000 / v22:
     86            TOTAL: 100% (79MB-85MB-102MB/78MB-83MB-100MB over 18)
     87       Persistent: 100% (79MB-85MB-102MB/78MB-83MB-100MB over 18)
     88   * com.rhapsody / u0a83 / v125:
     89            TOTAL: 100% (7.9MB-12MB-19MB/6.9MB-11MB-17MB over 15)
     90          Service: 100% (7.9MB-12MB-19MB/6.9MB-11MB-17MB over 15)
     91       Service Rs: 0.04%
     92   * com.qualcomm.qcrilmsgtunnel / 1001 / v22:
     93            TOTAL: 100% (2.5MB-2.6MB-2.7MB/1.7MB-1.8MB-1.9MB over 15)
     94          Service: 100% (2.5MB-2.6MB-2.7MB/1.7MB-1.8MB-1.9MB over 15)
     95       Service Rs: 0.13%
     96   * com.amazon.kindle / u0a82 / v1143472216:
     97            TOTAL: 100% (44MB-54MB-77MB/43MB-52MB-74MB over 17)
     98          Service: 100% (44MB-54MB-77MB/43MB-52MB-74MB over 17)
     99       Service Rs: 0.04%
    100   * com.outplaylab.VideoDiet2 / u0a93 / v21:
    101            TOTAL: 100% (2.8MB-3.1MB-4.0MB/2.0MB-2.2MB-3.0MB over 15)
    102          Service: 100% (2.8MB-3.1MB-4.0MB/2.0MB-2.2MB-3.0MB over 15)
    103       Service Rs: 0.03%
    104   * android.process.media / u0a6 / v800:
    105            TOTAL: 99% (4.6MB-5.9MB-8.1MB/3.4MB-4.7MB-6.7MB over 25)
    106           Imp Fg: 0.02%
    107          Service: 99% (4.6MB-5.9MB-8.1MB/3.4MB-4.7MB-6.7MB over 25)
    108       Service Rs: 0.02%
    109         (Cached): 0.94%
    110   * kr.sira.sound / u0a108 / v41:
    111            TOTAL: 77% (117MB-191MB-219MB/111MB-187MB-213MB over 68)
    112              Top: 77% (117MB-191MB-219MB/111MB-187MB-213MB over 68)
    113       (Last Act): 18% (58MB-127MB-161MB/53MB-123MB-158MB over 3)
    114         (Cached): 0.06%
    115   * com.google.android.gms / u0a8 / v7319438:
    116            TOTAL: 37% (41MB-45MB-57MB/38MB-42MB-53MB over 23)
    117              Top: 13% (41MB-46MB-57MB/39MB-42MB-53MB over 16)
    118           Imp Fg: 13% (41MB-44MB-47MB/39MB-41MB-44MB over 5)
    119           Imp Bg: 0.38%
    120          Service: 11% (42MB-42MB-42MB/38MB-38MB-38MB over 2)
    121         Receiver: 0.03%
    122       (Last Act): 2.0% (38MB-38MB-38MB/36MB-36MB-36MB over 1)
    123         (Cached): 61% (39MB-40MB-43MB/37MB-37MB-40MB over 28)
    124   * com.google.android.googlequicksearchbox / u0a22 / v300404573:
    125            TOTAL: 22% (129MB-153MB-162MB/125MB-149MB-156MB over 20)
    126              Top: 22% (129MB-153MB-162MB/125MB-149MB-156MB over 20)
    127           Imp Bg: 0.04%
    128         Receiver: 0.01%
    129           (Home): 78% (75MB-84MB-122MB/74MB-82MB-117MB over 12)
    130   * com.google.android.apps.thehub / u0a102 / v12:
    131            TOTAL: 21% (6.4MB-7.6MB-8.7MB/4.8MB-6.0MB-7.2MB over 2)
    132          Service: 21% (6.4MB-7.6MB-8.7MB/4.8MB-6.0MB-7.2MB over 2)
    133   * com.google.android.talk / u0a54 / v22314462:
    134            TOTAL: 9.3%
    135              Top: 0.04%
    136          Service: 9.3%
    137         Receiver: 0.01%
    138       (Last Act): 3.9% (69MB-70MB-71MB/67MB-68MB-69MB over 6)
    139         (Cached): 87% (42MB-53MB-77MB/40MB-51MB-74MB over 137)
    140   * com.google.android.apps.plus / u0a67 / v413836278:
    141            TOTAL: 8.2% (9.6MB-12MB-18MB/8.1MB-11MB-16MB over 3)
    142           Imp Bg: 0.10%
    143          Service: 8.0% (9.6MB-12MB-18MB/8.1MB-11MB-16MB over 3)
    144         Receiver: 0.05%
    145         (Cached): 59% (7.8MB-19MB-33MB/6.8MB-18MB-31MB over 22)
    146   * com.android.providers.calendar / u0a2 / v22:
    147            TOTAL: 3.5% (7.3MB-7.7MB-8.0MB/5.9MB-6.5MB-6.9MB over 10)
    148           Imp Bg: 0.32%
    149          Service: 3.2% (7.3MB-7.7MB-8.0MB/5.9MB-6.5MB-6.9MB over 10)
    150         Receiver: 0.01%
    151         (Cached): 69% (4.7MB-6.6MB-7.8MB/3.5MB-5.5MB-6.7MB over 23)
    152   * com.amazon.mShop.android / u0a104 / v5030102:
    153            TOTAL: 2.7% (25MB-40MB-47MB/24MB-37MB-43MB over 6)
    154          Service: 2.6% (25MB-40MB-47MB/24MB-37MB-43MB over 6)
    155         Receiver: 0.15%
    156         (Cached): 97% (25MB-33MB-48MB/24MB-31MB-44MB over 46)
    157   * com.google.android.gm / u0a70 / v51001620:
    158            TOTAL: 2.2% (209MB-209MB-209MB/203MB-203MB-203MB over 1)
    159              Top: 0.48% (209MB-209MB-209MB/203MB-203MB-203MB over 1)
    160           Imp Bg: 0.70%
    161          Service: 1.0%
    162         Receiver: 0.01%
    163       (Last Act): 0.02%
    164         (Cached): 94% (25MB-67MB-116MB/23MB-63MB-109MB over 61)
    165   * com.google.android.googlequicksearchbox:search / u0a22 / v300404573:
    166            TOTAL: 2.1% (66MB-66MB-66MB/63MB-63MB-63MB over 1)
    167              Top: 1.4% (66MB-66MB-66MB/63MB-63MB-63MB over 1)
    168           Imp Fg: 0.01%
    169          Service: 0.66%
    170         Receiver: 0.02%
    171         (Cached): 98% (52MB-59MB-79MB/50MB-56MB-77MB over 56)
    172   * com.google.android.calendar / u0a31 / v2015030452:
    173            TOTAL: 1.4%
    174           Imp Bg: 0.33%
    175          Service: 1.1%
    176         Receiver: 0.02%
    177         (Cached): 80% (7.4MB-12MB-17MB/5.8MB-9.8MB-14MB over 18)
    178   * com.android.vending / u0a16 / v80341100:
    179            TOTAL: 1.3% (88MB-154MB-220MB/85MB-151MB-217MB over 2)
    180              Top: 1.3% (88MB-154MB-220MB/85MB-151MB-217MB over 2)
    181          Service: 0.06%
    182         Receiver: 0.02%
    183       (Last Act): 4.4% (46MB-68MB-89MB/45MB-66MB-87MB over 2)
    184         (Cached): 11% (15MB-74MB-133MB/13MB-72MB-131MB over 2)
    185   * com.google.android.apps.photos / u0a65 / v5616:
    186            TOTAL: 0.94%
    187          Service: 0.90%
    188         Receiver: 0.04%
    189         (Cached): 80% (9.2MB-12MB-17MB/7.5MB-11MB-15MB over 20)
    190   * com.amazon.avod.thirdpartyclient / u0a107 / v451210:
    191            TOTAL: 0.52%
    192          Service: 0.49%
    193         Receiver: 0.03%
    194         (Cached): 97% (14MB-24MB-34MB/13MB-22MB-31MB over 40)
    195   * com.google.android.gms.wearable / u0a8 / v7319438:
    196            TOTAL: 0.51%
    197           Imp Fg: 0.47%
    198          Service: 0.04%
    199         (Cached): 65% (4.7MB-6.5MB-8.2MB/3.6MB-4.2MB-5.4MB over 10)
    200   * com.amazon.mShop.android.shopping / u0a103 / v5040011:
    201            TOTAL: 0.50%
    202          Service: 0.37%
    203         Receiver: 0.13%
    204         (Cached): 77% (13MB-17MB-21MB/11MB-15MB-19MB over 15)
    205   * com.google.android.gms:car / u0a8 / v7319438:
    206            TOTAL: 0.49% (7.1MB-7.1MB-7.1MB/4.3MB-4.3MB-4.3MB over 1)
    207              Top: 0.05%
    208           Imp Fg: 0.39% (7.1MB-7.1MB-7.1MB/4.3MB-4.3MB-4.3MB over 1)
    209          Service: 0.05%
    210         (Cached): 0.60% (6.6MB-6.6MB-6.6MB/3.6MB-3.6MB-3.6MB over 1)
    211   * com.amazon.mp3 / u0a92 / v4033010:
    212            TOTAL: 0.46%
    213          Service: 0.43%
    214         Receiver: 0.03%
    215         (Cached): 84% (12MB-16MB-23MB/9.7MB-14MB-21MB over 25)
    216   * com.android.chrome:privileged_process1 / u0a34 / v2272096:
    217            TOTAL: 0.43%
    218          Service: 0.04%
    219       Service Rs: 0.39%
    220         (Cached): 100% (2.9MB-4.0MB-4.9MB/1.7MB-2.9MB-3.9MB over 18)
    221   * com.google.android.dialer / u0a10 / v20100:
    222            TOTAL: 0.39% (93MB-93MB-93MB/89MB-89MB-89MB over 1)
    223              Top: 0.23% (93MB-93MB-93MB/89MB-89MB-89MB over 1)
    224           Imp Fg: 0.16%
    225         (Cached): 16% (5.0MB-31MB-57MB/4.1MB-29MB-54MB over 2)
    226   * com.google.android.apps.maps / u0a58 / v906101124:
    227            TOTAL: 0.38%
    228          Service: 0.33%
    229         Receiver: 0.05%
    230         (Cached): 69% (8.7MB-15MB-18MB/7.2MB-14MB-17MB over 8)
    231   * com.google.android.youtube / u0a80 / v101451214:
    232            TOTAL: 0.26%
    233          Service: 0.26%
    234         (Cached): 36% (15MB-22MB-29MB/13MB-19MB-27MB over 5)
    235   * com.google.android.apps.fitness / u0a45 / v2015109100:
    236            TOTAL: 0.26%
    237          Service: 0.23%
    238         Receiver: 0.02%
    239         (Cached): 82% (3.9MB-6.4MB-9.2MB/2.8MB-5.3MB-7.9MB over 19)
    240   * com.google.android.apps.enterprise.dmagent / u0a37 / v630:
    241            TOTAL: 0.06%
    242          Service: 0.06%
    243         Receiver: 0.01%
    244         (Cached): 2.2% (6.5MB-7.4MB-8.2MB/4.8MB-5.8MB-6.8MB over 2)
    245   * com.audible.application / u0a95 / v3068:
    246            TOTAL: 0.06%
    247         Receiver: 0.06%
    248         (Cached): 34% (14MB-16MB-19MB/11MB-14MB-17MB over 7)
    249   * com.android.defcontainer / u0a5 / v22:
    250            TOTAL: 0.06%
    251           Imp Fg: 0.06%
    252         (Cached): 0.12%
    253   * com.google.android.music:main / u0a60 / v1847:
    254            TOTAL: 0.04%
    255              Top: 0.01%
    256          Service: 0.02%
    257         Receiver: 0.01%
    258         (Cached): 9.8% (10MB-12MB-14MB/8.3MB-9.6MB-11MB over 2)
    259   * com.google.android.apps.magazines / u0a61 / v2015040100:
    260            TOTAL: 0.03%
    261              Top: 0.02%
    262         Receiver: 0.01%
    263         (Cached): 8.7% (12MB-14MB-16MB/9.7MB-11MB-13MB over 2)
    264   * com.google.android.videos / u0a77 / v37191:
    265            TOTAL: 0.03%
    266           Imp Fg: 0.01%
    267          Service: 0.02%
    268         (Cached): 1.3% (11MB-12MB-13MB/9.1MB-10MB-12MB over 2)
    269   * com.google.android.apps.books / u0a28 / v30336:
    270            TOTAL: 0.03%
    271           Imp Fg: 0.01%
    272          Service: 0.02%
    273         (Cached): 1.3% (7.9MB-9.6MB-11MB/6.3MB-8.0MB-9.7MB over 2)
    274   * com.google.android.keep / u0a71 / v3115:
    275            TOTAL: 0.02%
    276          Service: 0.01%
    277         Receiver: 0.01%
    278         (Cached): 11% (6.3MB-8.7MB-9.6MB/5.1MB-7.4MB-8.3MB over 4)
    279   * com.android.chrome / u0a34 / v2272096:
    280            TOTAL: 0.02%
    281          Service: 0.01%
    282         Receiver: 0.02%
    283         (Cached): 90% (5.1MB-70MB-96MB/3.4MB-66MB-92MB over 15)
    284   * com.google.android.apps.gcs / u0a94 / v14:
    285            TOTAL: 0.02%
    286          Service: 0.02%
    287         (Cached): 17% (5.8MB-5.9MB-6.0MB/4.6MB-4.7MB-4.8MB over 2)
    288   * com.android.chrome:privileged_process0 / u0a34 / v2272096:
    289            TOTAL: 0.02%
    290          Service: 0.01%
    291         Receiver: 0.01%
    292         (Cached): 73% (162MB-163MB-164MB/157MB-157MB-157MB over 13)
    293   * com.android.chrome:sandboxed_process12 / u0a34 / v2272096:
    294            TOTAL: 0.02%
    295          Service: 0.01%
    296         Receiver: 0.01%
    297         (Cached): 73% (48MB-49MB-51MB/46MB-47MB-50MB over 13)
    298   * com.google.android.apps.docs / u0a40 / v51410735:
    299            TOTAL: 0.01%
    300         Receiver: 0.01%
    301         (Cached): 0.45% (10MB-10MB-10MB/9.3MB-9.3MB-9.3MB over 1)
    302   * com.google.android.deskclock / u0a38 / v303:
    303            TOTAL: 0.01%
    304         Receiver: 0.01%
    305         (Cached): 82% (2.5MB-3.3MB-4.3MB/1.7MB-2.3MB-3.2MB over 13)
    306   * com.google.android.gm.exchange / u0a69 / v500065:
    307            TOTAL: 0.01%
    308           Imp Bg: 0.01%
    309         (Cached): 27% (3.3MB-3.7MB-3.9MB/2.2MB-2.7MB-2.9MB over 6)
    310   * com.android.cellbroadcastreceiver / u0a3 / v22:
    311            TOTAL: 0.01%
    312          Service: 0.01%
    313         (Cached): 1.1% (3.5MB-3.5MB-3.5MB/2.5MB-2.5MB-2.5MB over 1)
    314   * com.coulombtech / u0a106 / v26:
    315            TOTAL: 0.01%
    316         Receiver: 0.01%
    317         (Cached): 21% (4.9MB-5.0MB-5.2MB/3.8MB-3.9MB-4.1MB over 2)
    318   * com.softcoil.mms / u0a86 / v32:
    319            TOTAL: 0.01%
    320         (Cached): 0.25%
    321   * com.udemy.android / u0a91 / v38:
    322            TOTAL: 0.01%
    323         Receiver: 0.01%
    324         (Cached): 0.75% (9.8MB-9.8MB-9.8MB/8.5MB-8.5MB-8.5MB over 1)
    325   * com.qualcomm.timeservice / u0a76 / v22:
    326         (Cached): 16% (2.3MB-2.4MB-2.4MB/1.6MB-1.6MB-1.6MB over 4)
    327   * com.lge.SprintHiddenMenu / 1000 / v22:
    328         (Cached): 0.16%
    329   * com.android.chrome:sandboxed_process13 / u0a34 / v2272096:
    330         (Cached): 0.01%
    331   * com.google.android.partnersetup / u0a13 / v22:
    332         (Cached): 0.14%
    333   * com.android.musicfx / u0a15 / v10400:
    334         (Cached): 0.41% (2.5MB-2.5MB-2.5MB/1.6MB-1.6MB-1.6MB over 1)
    335   * com.android.chrome:sandboxed_process9 / u0a34 / v2272096:
    336         (Cached): 30% (34MB-34MB-34MB/32MB-32MB-32MB over 9)
    337   * com.android.chrome:sandboxed_process11 / u0a34 / v2272096:
    338         (Cached): 7.2% (56MB-56MB-56MB/54MB-54MB-54MB over 3)
    339 
    340 Run time Stats:
    341   SOff/Norm: +32m52s226ms
    342   SOn /Norm: +2h10m8s364ms
    343        Mod : +17s930ms
    344       TOTAL: +2h43m18s520ms
    345 
    346 Memory usage:
    347   Kernel : 265MB (38 samples)
    348   Native : 73MB (38 samples)
    349   Persist: 262MB (90 samples)
    350   Top    : 190MB (325 samples)
    351   ImpFg  : 204MB (569 samples)
    352   ImpBg  : 754KB (345 samples)
    353   Service: 93MB (1912 samples)
    354   Receivr: 227KB (1169 samples)
    355   Home   : 66MB (12 samples)
    356   LastAct: 30MB (255 samples)
    357   CchAct : 220MB (450 samples)
    358   CchCAct: 193MB (71 samples)
    359   CchEmty: 182MB (652 samples)
    360   Cached : 58MB (38 samples)
    361   Free   : 60MB (38 samples)
    362   TOTAL  : 1.9GB
    363   ServRst: 50KB (278 samples)
    364 
    365           Start time: 2015-04-08 13:44:18
    366   Total elapsed time: +2h43m18s521ms (partial) libart.so
    367 </pre>
    368 
    369