View memory usage in Linux and Android

Source: Internet
Author: User

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
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.