Vss/rss/pss/uss of Android Memory

Source: Internet
Author: User

Terms

    • Vss-virtual Set Size Virtual memory consumption (contains memory consumed by shared libraries)
    • Rss-resident Set Size actually uses physical memory (contains memory consumed by shared libraries)
    • Pss-proportional Set Size Actual physical memory used (proportional allocation of memory consumed by shared libraries)
    • Uss-unique the Set Size process consumes the physical memory alone (does not contain the memory occupied by the shared library)

In general, memory footprint has the following rules: VSS >= RSS >= PSS >= USS

Overview

The aim of this post was to provide information that would assist in interpreting memory reports from various tools so the T Rue memory usage for Linux processes and the system can is determined.

Android have a tool called Procrank (/system/xbin/procrank), which lists out the memory usage of Linux processes in order F Rom highest to lowest usage. The sizes reported per process is VSS, RSS, PSS, and USS.

For the sake of simplicity in this description, memory would be a expressed in terms of pages, rather than bytes. Linux systems like ours manage memory in 4096 bytes pages at the lowest level.

VSS (reported as VSZ from PS) are the total accessible address space of a process. This is the size also includes memory that May is resident in RAM like Mallocs that has been allocated but not written to. VSS is of very little use for determing real memory usage of a process.

RSS is the total memory actually held in RAM for a process. RSS can be misleading, because it reports the total all of the the the A-Libraries that process uses, even though a share D library is a loaded into memory once regardless of what many processes use it. RSS isn't an accurate representation of the memory usage for a single process.

pss differs from RSS on that it reports the proportional size of its shared Librari ES, i.e. if three processes all use a shared libraries that have pages, that library would only contribute pages to the PSS is reported for each of the three processes. PSS is a very useful number because if the PSS for all processes in the system is summed together, which is a good repre Sentation for the total memory usage in the system. When a process was killed, the shared libraries that contributed to its PSS would be proportionally distributed to the PSS T Otals for the remaining processes still using that library. In this-a-slightly misleading, because when a process is killed, PSS does not accurately represent the memory Returned to the overall system.

USS is the total private memory for a process, i.e. that's memory that's 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 was killed, the USS is actually returned to the system. USS is the best number to watch when initially suspicious of memory leaks in a process.

For systems that has Python available, there is also a nice tool called Smem that would report memory statistics including All of these categories.

# Procrank
Procrank
PID Vss Rss Pss Uss cmdline
481 31536K 30936K 14337K 9956K system_server
475 26128K 26128K 10046K 5992K zygote
526 25108K 25108K 9225K 5384K android.process.acore
523 22388K 22388K 7166K 3432K com.android.phone
574 21632K 21632K 6109K 2468K com.android.settings
521 20816K 20816K 6050K 2776K jp.co.omronsoft.openwnn
474 3304K 3304K 1097K 624k/system/bin/mediaserver
PNS 304K 304K 289K 288k/sbin/adbd
720K 720K 261K 212k/system/bin/rild
601 412K 412K 225K 216K procrank
1 204K 204K 185K 184k/init
388K 388K 182K 172k/system/bin/qemud
284 384K 384K 160K 148K Top
376K 376K 148K 136k/system/bin/vold
261 332K 332K 123K 112K logcat
396K 396K 105K 80k/system/bin/keystore
316K 316K 100K 88k/system/bin/installd
269 328K 328K 95K 72k/system/bin/sh
280K 280K 93K 84k/system/bin/servicemanager
304K 304K 91K 80k/system/bin/qemu-props
324K 324K 91K 68k/system/bin/sh
260 324K 324K 91K 68k/system/bin/sh
324K 324K 91K 68k/system/bin/sh
308K 308K 88K 68k/system/bin/sh
232K 232K 67K 60k/system/bin/debuggerd
#

Original Address http://hi.baidu.com/donghaozheng/blog/item/235da701ab70f60a1c95832e.html

Vss/rss/pss/uss of Android Memory

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.