1. procrank (only for Android)
It reads information from/proc/Pid/maps for statistics. The source code is located at:/system/extras/procrank
Memory consumption: VSS/RSS/PSS/USS
• VSS-virtual set size virtual memory consumption (including memory occupied by shared libraries)
• RSS-resident set size actually uses physical memory (including memory occupied by shared libraries)
• Pss-proportional set size physical memory actually used (proportional allocation of memory occupied by the Shared Library)
• Uss-unique set size physical memory occupied by the process (excluding the memory occupied by the Shared Library)
2. CAT/proc/Pid/status
Vmpeak: indicates the maximum virtual memory occupied by a process.
Vmsize: indicates the current virtual memory size of the process.
Vmlck: memory size locked
Vmhwm: indicates the peak value of the physical memory occupied by the process.
Vmrss: indicates the size of the physical memory occupied by the process (with RSS in procrank)
Vmdata: Specifies the Data Segment Size of a process.
Vmstk: indicates the size of the process stack segment.
Vmexe: indicates the size of the Process Code.
Vmlib: indicates the size of the shared library used by the process.
Vmpte: indicates the size of the table items on the process page.
3. Example
shell@android:/ $ procrank PID Vss Rss Pss Uss cmdline16044 247156K 94580K 81361K 79708K com.android.pingpang16698 242440K 66436K 45516K 42064K com.android.yujiashell@android:/ $ cat /proc/16044/status VmPeak: 703476 kBVmSize: 550940 kBVmLck: 0 kBVmHWM: 101500 kBVmRSS: 94140 kBVmData: 102016 kBVmStk: 136 kBVmExe: 8 kBVmLib: 37968 kBVmPTE: 346 kBVmSwap: 0 kBThreads:22shell@android:/ $ cat /proc/16698/status VmPeak: 693460 kBVmSize: 516736 kBVmLck: 0 kBVmHWM: 71204 kBVmRSS: 66060 kBVmData: 58960 kBVmStk: 136 kBVmExe: 8 kBVmLib: 46568 kBVmPTE: 344 kBVmSwap: 0 kBThreads:26
Reference: http://www.kernel.org/doc/man-pages/online/pages/man5/proc.5.html