Dumpsys meminfo

来源:互联网 发布:centos 7开机选项 编辑:程序博客网 时间:2024/05/18 01:22

1 Dumpsys meminfo

  • This command can be used to observe how your app’s memory is distributed to different types of RAM allocation.

2 Command usage

adb shell dumpsys meminfo <package_name or pid>

3 Output sample

# adb shell dumpsys meminfo com.android.settingsApplications Memory Usage (kB):Uptime: 2134862 Realtime: 2134849** MEMINFO in pid 21074 [com.android.settings] **                   Pss      Pss   Shared  Private   Shared  Private  Swapped     Heap     Heap     Heap                 Total    Clean    Dirty    Dirty    Clean    Clean    Dirty     Size    Alloc     Free                ------   ------   ------   ------   ------   ------   ------   ------   ------   ------  Native Heap     7353        0     1624     7304        0        0        0     9368     7139     2228  Dalvik Heap    14429        0    18304    14000        0        0        0    32901    28569     4332 Dalvik Other      896        0       16      896        0        0        0                                   Stack      480        0        0      480        0        0        0                                 Gfx dev     4366        0      252     4240        0        0        0                               Other dev        5        0       56        0        0        4        0                                .so mmap      692       36     1944      328     9044       36        0                               .apk mmap      436       68        0        0     1800       68        0                               .ttf mmap       87        0        0        0      544        0        0                               .dex mmap      716      712        0        0        8      712        0                               .oat mmap      451       76        0        0     8164       76        0                               .art mmap     1543       20     3624     1364     1420       20        0                              Other mmap       16        0       12        4      292        0        0                              EGL mtrack    39808        0        0    39808        0        0        0                               GL mtrack    14040        0        0    14040        0        0        0                                 Unknown      600        0       80      600        0        0        0                                   TOTAL    85918      912    25912    83064    21272      916        0    42269    35708     6560 Dalvik Details        .Heap     6004        0        0     6004        0        0        0                                    .LOS     7276        0        0     7276        0        0        0                                     .GC      868        0        8      868        0        0        0                                 .Zygote      829        0    18304      400        0        0        0                              .NonMoving      320        0        0      320        0        0        0                            .IndirectRef       28        0        8       28        0        0        0                            Objects               Views:      429         ViewRootImpl:        2         AppContexts:        4           Activities:        2              Assets:        2        AssetManagers:        2       Local Binders:       23        Proxy Binders:       29       Parcel memory:        5         Parcel count:       20    Death Recipients:        1      OpenSSL Sockets:        0 SQL         MEMORY_USED:      108  PAGECACHE_OVERFLOW:       24          MALLOC_SIZE:       62 DATABASES      pgsz     dbsz   Lookaside(b)          cache  Dbname         4      320             40         2/21/3  /data/data/com.android.settings/databases/search_index.db

4 Column information

  • Native heap
    • This column counts the total PSS of memory region [anon:libc_malloc] and [heap].
    • Please refer to Memory region for more information
  • Dalvik Heap
    • For KitKat: This column counts the total PSS of memory region /dev/ashmem/dalvik-heap and /dev/ashmem/dalvik-zygote
    • For Lollipop: This column counts the total PSS of memory region /dev/ashmem/dalvik-main space, /dev/ashmem/dalvik-allocspace, /dev/ashmem/dalvik-large object space, /dev/ashmem/dalvik-zygote space, /dev/ashmem/dalvik-non moving space
    • Please refer to Memory region for more information
  • Dalvik Other
    • The memory resions with prefix name /dev/ashmem/dalvik-* except the regions counted in Dalvik Heap.
    • Ex: /dev/ashmem/dalvik-card, /dev/ashmem/dalvik-indirect …
  • Other dev
    • The memory regions with prefix name /dev/* except the the regions listed in Dalvik Heap, Dalvik Other and ASHMEM
    • For KitKat and QCT platform, the major contributor of “Other dev” should be /dev/kgsl-3d0.
    • Since Lollipop 5.1, Google creates the “Gfx dev” column for counting the usage of /dev/kgsl-3d0
  • Gfx dev
    • Newly added since Lollipop 5.1
    • The PSS of /dev/kgsl-3d0 memory region
  • EGL memtrack
    • You will see this column when display driver’s memtrack module is enabled
    • Before Lollipop5.1, this column is named “Graphics”.
    • EGL memtrack memory is the summary of all surface buffers(the surface buffer increases to triple buffer after Android 4.1) and the size of the Atlas buffer. However, Atlas buffer is actually a shared memory and shouldn’t be accounted into each UI process’ memory usage to overcount the memory usage. Both surface buffer and Atlas buffer’s memory quota is reserved in project’s memory estimation, thus the memory usage of these buffers should be separately accounted from process’ memory usage. So when you measure process’ memory usage, you can ignore this column.
  • GL memtrack
    • You will see this column when display driver’s memtrack module is enabled
    • Before Lollipop5.1, this column is named “GL”.
    • HW acceleration memory is partially counted in process PSS. For example, for QCT platform the HW acceleration memory is partially counted in the PSS of /dev/kgsl-3d0 as we mentioned in the “Gfx dev” section. GL memtrack memory usage calculates the unaccounted /dev/kgsl-3d0 memory regions which PSS value equals 0.
    • Please be noticed that the summation of GL memtrack and Gfx dev doesn’t reflect the complete HW acceleration memory since the full HW acceleration memory usage should be counted with the VSS of /dev/kgsl-3d0. So the “TOTAL” value of dumpsys meminfo is smaller than actual physical memory usage.
  • Unknown
    • This column counts the total PSS of memory region [anonymous]
    • Please refer to Memory region for more information
  • Private (Clean and Dirty) RAM
    • This is memory that is being used by only your process. This is the amount of the RAM that the system can reclaim when your app’s process is destroyed. Generally, the most important portion of this is “private dirty” RAM, which is the most expensive because it is used by only your process. All Dalvik and native heap allocations you make will be private dirty RAM; Dalvik and native allocations you share with the Zygote process are shared dirty RAM.
  • ViewRootImpl
    • The number of root views that are active in your process. Each root view is associated with a window, so this can help you identify memory leaks involving dialogs or other windows.
  • AppContexts and Activities
    • The number of app Context and Activity objects that currently live in your process. This can be useful to quickly identify leaked Activity objects that can’t be garbage collected due to static references on them, which is common. These objects often have a lot of other allocations associated with them and so are a good way to track large memory leaks.
0 0
原创粉丝点击