Terms

  • VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
  • RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存)
  • PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
  • USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)

一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS

Overview

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

Android has a tool called procrank (/system/xbin/procrank), which lists out the memory usage of linuxprocesses in order from highest to lowest usage. The sizes reported per process are VSS, RSS, PSS, and USS.

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

VSS (reported as VSZ from ps) is the total accessible address space of a process.This size also includes memory that may not be resident in RAM like mallocs that have 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 shared libraries that the process uses, even though a shared library is only loaded into memory once regardless of how many processes use it. RSS is not an accurate representation of the memory usage for a single process.

PSS differs from RSS in that it reports the proportional size of its shared libraries, i.e. if three processes all use a shared library that has 30 pages, that library will only contribute 10 pages to the PSS that is reported for each of the three processes. PSS is a very useful number because when the PSS for all processes in the system are summed together, that is a good representation for the total memory usage in the system. When a process is killed, the shared libraries that contributed to its PSS will be proportionally distributed to the PSS totals for the remaining processes still using that library. In this way PSS can be 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 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 leaksin a process.

For systems that have Python available, there is also a nice tool calledsmem that will report memory statistics including all of these categories.

【转】内存耗用:VSS/RSS/PSS/USS的更多相关文章

  1. Android内存之VSS/RSS/PSS/USS

    Terms VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS - P ...

  2. 内存耗用:VSS/RSS/PSS/USS

    Terms VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS - P ...

  3. 内存VSS/RSS/PSS/USS名词解释

    VSS(virtual set size)虚拟耗用内存(包含共享库占用的内存) RSS(Resident set size)实际使用物理内存(包含共享库占用的内存) RSS是进程实际驻存在物理内存的部 ...

  4. 【Android手机测试】linux内存管理 -- 一个进程占多少内存?四种计算方法:VSS/RSS/PSS/USS

    在Linux里面,一个进程占用的内存有不同种说法,可以是VSS/RSS/PSS/USS四种形式,这四种形式首字母分别是Virtual/Resident/Proportional/Unique的意思. ...

  5. Linux内存管理 一个进程究竟占用多少空间?-VSS/RSS/PSS/USS

    关键词:VSS.RSS.PSS.USS._mapcount.pte_present.mem_size_stats. 在Linux里面,一个进程占用的内存有不同种说法,可以是VSS/RSS/PSS/US ...

  6. VSS/RSS/PSS/USS

    [VSS/RSS/PSS/USS] Android has a tool called procrank (/system/xbin/procrank), which lists out the me ...

  7. android内存耗用:VSS/RSS/PSS/USS

    VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)  不是真实当前应用进程所占用的内存. 内存分配的原理 从操作系统角度来看,进程分配内存有两种方式,分别由两个系统调用完 ...

  8. [转]Android中内存占用的含义:(VSS,PSS,RSS,USS)

    Android中内存占用的含义:(VSS,PSS,RSS,USS) 作者: andforce 分类: 安卓系统 发布时间: 2013-09-07 00:03 ė1,915 浏览数 6没有评论 在eng ...

  9. JAVA 大数据内存耗用测试

    JAVA 大数据内存耗用测试import java.lang.management.ManagementFactory;import java.lang.management.MemoryMXBean ...

随机推荐

  1. ueditor编辑器【实际项目使用】

    [页面效果] [代码] 说明: ueditor插件的公共代码: 如果是一个可以放在对应模块的js代码中   如果有多个就要提到全局的高度(即提到公共部分) <script type=" ...

  2. 每天一个linux命令:【转载】head命令

    head 与 tail 就像它的名字一样的浅显易懂,它是用来显示开头或结尾某个数量的文字区块,head 用来显示档案的开头至标准输出中,而 tail 想当然尔就是看档案的结尾. 1.命令格式: hea ...

  3. qt creator在Qt5中中文显示的问题

    当我们用Qt Creater时,经常出会出现如下问题: 处理方法如下:用记事本打开你的源代码,然后点另存为,utf-8,编码覆盖,这时中文就没问题了但是会乱码.在字符串前加个宏QStringLiter ...

  4. python 抓取网页一部分

    import re import requests from bs4 import BeautifulSoup response = requests.get("https://jecvay ...

  5. BZOJ5369 [Pkusc2018]最大前缀和

    题意 小C是一个算法竞赛爱好者,有一天小C遇到了一个非常难的问题:求一个序列的最大子段和. 但是小C并不会做这个题,于是小C决定把序列随机打乱,然后取序列的最大前缀和作为答案. 小C是一个非常有自知之 ...

  6. 坚持c++,真正掌握c++(4)

    这几天复习了c++primer的第12章类的解说,尽管之前这一章也看了几遍.可是我终究认为书读百遍其义自现,如今我给出一些我学习的心得,欢迎大家一起探讨. 首先,类能够说是c++的灵魂,正由于c++中 ...

  7. Spring AOP表达式报错:Pointcut is not well-formed: expecting 'name pattern' at character position

    问题现象: java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test ...

  8. eclipse导出jar,再转换为exe可执行程序

    转自: https://blog.csdn.net/mommomm/article/details/8227876 若只想知道如何把jar转换成exe,直接看第四步即可. 一.导出jar文件: 选中你 ...

  9. RK3288 手动设置电池电量

    参考:[RK3288][Android6.0] 调试笔记 --- 电池电量一直显示100% 系统版本:RK3288 android 5.1 (与参考的变量和宏有点区别) 设备没有电池,在进行Fota升 ...

  10. MOSS 2013研究系列---修改默认Logo

    开发SharePoint2013 的时候,系统里面有一个“SharePoint” 的logo,客户很少不满意,我们的系统不能出现产品的名称,如下图: 咋么修改呢,咨询了广大网友,给出了一个解决方案: ...