【转】内存耗用:VSS/RSS/PSS/USS
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的更多相关文章
- Android内存之VSS/RSS/PSS/USS
Terms VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS - P ...
- 内存耗用:VSS/RSS/PSS/USS
Terms VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS - P ...
- 内存VSS/RSS/PSS/USS名词解释
VSS(virtual set size)虚拟耗用内存(包含共享库占用的内存) RSS(Resident set size)实际使用物理内存(包含共享库占用的内存) RSS是进程实际驻存在物理内存的部 ...
- 【Android手机测试】linux内存管理 -- 一个进程占多少内存?四种计算方法:VSS/RSS/PSS/USS
在Linux里面,一个进程占用的内存有不同种说法,可以是VSS/RSS/PSS/USS四种形式,这四种形式首字母分别是Virtual/Resident/Proportional/Unique的意思. ...
- Linux内存管理 一个进程究竟占用多少空间?-VSS/RSS/PSS/USS
关键词:VSS.RSS.PSS.USS._mapcount.pte_present.mem_size_stats. 在Linux里面,一个进程占用的内存有不同种说法,可以是VSS/RSS/PSS/US ...
- VSS/RSS/PSS/USS
[VSS/RSS/PSS/USS] Android has a tool called procrank (/system/xbin/procrank), which lists out the me ...
- android内存耗用:VSS/RSS/PSS/USS
VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) 不是真实当前应用进程所占用的内存. 内存分配的原理 从操作系统角度来看,进程分配内存有两种方式,分别由两个系统调用完 ...
- [转]Android中内存占用的含义:(VSS,PSS,RSS,USS)
Android中内存占用的含义:(VSS,PSS,RSS,USS) 作者: andforce 分类: 安卓系统 发布时间: 2013-09-07 00:03 ė1,915 浏览数 6没有评论 在eng ...
- JAVA 大数据内存耗用测试
JAVA 大数据内存耗用测试import java.lang.management.ManagementFactory;import java.lang.management.MemoryMXBean ...
随机推荐
- LOJ2362. 「NOIP2016」蚯蚓【单调队列】
LINK 思路 良心来说这题还挺思维的 我没看题解也不知道要这样维护 把每次斩断的点分别放进两个队列里面 因为要维护增长,所以可以让新进队的节点来一个负增长? 是不是就好了? 然后很容易发现因为在原始 ...
- 从 “x is null 和 x == null” 的区别看 C# 7 模式匹配中常量和 null 的匹配
尝试过写 if (x is null)?它与 if (x == null) 相比,孰优孰劣呢? x is null 还有 x is constant 是 C# 7.0 中引入的模式匹配(Pattern ...
- 微信小程序(1)——小程序的特点以及结构
简单的,用完即走的应用 低频应用 性能要求不高的应用 应用程序入口(app.js app.json app.wxss) 一级页面:wxml,wxss,js,json 二级页面:wxml,wxss ...
- ubuntu换系统下载路径源
ubuntn默认下载路径的源是国外的下载很慢换成国内的下载路径会好很多 在ubuntu应用搜索框(左上脚那个)中输入software 1.software&Updates 应用点击softwa ...
- ballerina 学习十二 变量
ballerina 有两种方式进行变量的定义,类型加上名称以及初始值.,使用var 关键字 简单例子 代码 import ballerina/io; // 全局public 变量,使用类型定义 pub ...
- 使用 openresty 修改请求内容
1. 目的 动态修改 html 页面内容 2. 使用方式 openresty 在 header_filter 阶段 以及body_filter 阶段进行数据修改 3. 源码 此 ...
- Cocos2d-x学习笔记1
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/u014734779/article/details/26077453 1.创建新的cocos2d-x ...
- (三)、Fiddler的使用
Fiddler的基本使用 1.先来看看Fiddler的基本界面 会话列表中各项的意思: Result: 表示HTTP返回的状态码 Protocal: 请求的协议,如:HTTP.HTTPS Host: ...
- string源码分析 ——转载 http://blogs.360.cn/360cloud/2012/11/26/linux-gcc-stl-string-in-depth/
1. 问题提出 最近在我们的项目当中,出现了两次与使用string相关的问题. 1.1. 问题1:新代码引入的Bug 前一段时间有一个老项目来一个新需求,我们新增了一些代码逻辑来处理这个新需求.测试阶 ...
- GNU Radio安装教程: Ubuntu14.04 + uhd3.10.0 + gnuradio3.7.10.1
1. 更新和安装依赖项 在编译安装uhd和gnuradio之前,确保已安装所需依赖项.Ubuntu系统运行: sudo apt-get update 安装UHD和GNURadio所需依赖项: On U ...