5

When I run "adb shell dumpsys meminfo" on android 4.2, I get the result like

                                 Shared  Private     Heap     Heap     Heap
               Pss    Dirty    Dirty     Size    Alloc     Free
            ------   ------   ------   ------   ------   ------
   Native       28        8       28    16404    12256     3663
   Dalvik    14062    10060    13736    20032    15254     4778
   Cursor        0        0        0                           
   Ashmem        0        0        0                           
Other dev     4762     9556        0                           
 .so mmap    11699     1824     1500                           
.jar mmap        0        0        0                           
.apk mmap      368        0        0                           
.ttf mmap      811        0        0                           
.dex mmap     3736        0        0                               
Other mmap      114       16       32                           
   Unknown    12064      544    12052                           
     TOTAL    47644    22008    27348    36436    27510     8441

I have read the page of How do I discover memory usage of my application in Android?, but still have several questions:

  • Why the native Pss, shared dirty private dirty is very small?
  • the heap size should be smaller than Pss?
  • What does Unknown mean? Seems very big.
  • If I want to know how much memory my app uses, which data should I use? The Total Pss? But it doesn't include the native Pss which is nealy zero?
Community
  • 1
  • 1
Hui Liu
  • 51
  • 1
  • 1
  • 2

1 Answers1

2

Please refer to the question How do I discover memory usage of my application in Android?. I would also like you to refer to Detail VSS,RSS,PSS,USS link. The most appropriate data to use for a particular app is USS (Unique Set Size ) as

USS is the total private memory for a process, i.e. that memory that is completely unique to that process . USS is an extremely useful number because it indicates the true incremental cost of running a particular process. When a process is killed, the USS is the total memory that is actually returned to the system. USS is the best number to watch when initially suspicious of memory leaks in a process.

which you can get by adb shell procrank | grep <your.package.name>

Community
  • 1
  • 1
Lord Nick
  • 582
  • 8
  • 29