转自:http://www.douban.com/note/161471809/

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. 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 Linux processes 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 leaks in a process. For systems that have Python available, there is also a nice tool called smem that will report memory statistics including all of these categories.

linux 进程的vss rss uss,内核/内存管理中的VSS/RSS/PSS/USS相关推荐

  1. Linux进程间的通信----->共享内存

    共享内存:         顾名思义,共享内存就是允许两个不相关的进程访问同一个逻辑内存.共享内存是在两个正在运行的进程之间共享和传递数据的一种非常有效的方式.不同进程之间共享的内存通常安排为同一段物 ...

  2. linux进程间的通信(C): 共享内存

    一.共享内存介绍 共享内存是三个IPC(Inter-Process Communication)机制中的一个. 它允许两个不相关的进程访问同一个逻辑内存. 共享内存是在两个正在进行的进程之间传递数据的 ...

  3. linux进程阻塞的原因,释放大块内存时的阻塞问题

    一.前言 在堆上申请和释放内存的性能不高,这应该是常识了,尤其释放大块内存时,耗时更长,甚至会阻塞其他线程.做性能优化时,一般会采用内存池等手段避免频繁的申请和释放内存.本文从内核的角度分析申请和释放 ...

  4. 怎样搞懂Linux内核内存管理中的KASAN实现原理

    前言 KASAN是一个动态检测内存错误的工具.KASAN可以检测全局变量.栈.堆分配的内存发生越界访问等问题.功能比SLUB DEBUG齐全并且支持实时检测.越界访问的严重性和危害性通过我之前的文章( ...

  5. linux内核函数kmalloc,Linux_Linux平台上几个常见内核内存分配函数,* kmallocPrototype:#incl - phpStudy...

    Linux平台上几个常见内核内存分配函数 * kmalloc Prototype: #include void *kmalloc(size_t size, int flags); Kmalloc分配一 ...

  6. linux共享内存示例,linux 进程间共享内存示例

    写入端: #include #include #include #include #include using namespace std; struct MappingDataType { int ...

  7. linux进程--虚拟地址空间布局(十一)

    在多任务操作系统中,每个进程都运行在属于自己的内存沙盘中.这个沙盘就是虚拟地址空间(Virtual Address Space),在32位模式下它是一个4GB的内存地址块.在Linux系统中, 内核进 ...

  8. linux 进程地址空间的一步步探究

    我们知道,在32位机器上linux操作系统中的进程的地址空间大小是4G,其中0-3G是用户空间,3G-4G是内核空间.其实,这个4G的地址空间是不存在的,也就是我们所说的虚拟内存空间. 那虚拟内存空间 ...

  9. Linux进程地址空间探究

    我们知道,在32位机器上linux操作系统中的进程的地址空间大小是4G,其中0-3G是用户空间,3G-4G是内核空间.其实,这个4G的地址空间是不存在的,也就是我们所说的虚拟内存空间. 那虚拟内存空间 ...

最新文章

  1. 第六篇:协调和协定之组通信
  2. sql instr()与LOCATE()字符串查找函数
  3. bzoj1025 [SCOI2009]游戏 动态规划
  4. 网站添加自己公司的地图(使用的百度地图)时只显示一个空白框
  5. json里面返回模板输出的html,在JSON响应中返回完整页面的HTML而不是字符串输出...
  6. 2013年网络安全事件盘点
  7. 研究SAP service order status存储字段
  8. 做简单的android 软件推荐,Android_适用于Android开发的简单聊天软件,适用于android 开发。是一个简 - phpStudy...
  9. 解决Xshell无法连接虚拟机CentOS7问题
  10. Android实现小圆点显示未读功能
  11. 背景透明,文字不透明效果
  12. 523. 连续的子数组和
  13. 才知道系列之GroupOn
  14. c#无标题窗口的拖动
  15. 昱君金融超市西祠版开通了
  16. 机器学习中的数学——结构化概率模型/图模型
  17. 简单代码变出超个性化的QQ昵称
  18. 常犇_专访丨《河神》制片人常犇:走夜路不怕黑,做好剧别怕累
  19. 孩子长高应该吃什么呢?
  20. document.getElementById与getElementsByName的区别(注意后者多个S)

热门文章

  1. java 精选选择题_Java生产率提示:社区精选
  2. rxjava 循环发送事件_使用RxJava和SseEmitter进行服务器发送的事件
  3. aix pax_通过Pax考试对JBoss Fuse 6.x进行集成测试,第一部分
  4. javafx canvas_JavaFX技巧1:可调整大小的Canvas
  5. J2Pay –实施网关
  6. java 开发人员工具_Java开发人员的5种工具
  7. 内部简单二进制编码(SBE)
  8. 面向Java程序员的20大Spring REST面试问题答案
  9. Spring Cloud配置–外部化应用程序配置
  10. unity 飞机 残骸模型_训练残骸模式– Java 8中的改进实现