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

转自: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.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/333422.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何将类加载到内存

// 将类Driver加载到内存,在内存会产生一个和类Driver对应的Class实例 Class class Class.forName("com.mysql.jdbc.Driver");// 获取类加载器,任何类都有个class属性,这个属性返回类在内存中对应的那个Class实例,通过…

idea资源包下创建资源包_根据谁创建资源授权资源

idea资源包下创建资源包我的一位同事向我提出了一个关于StackOverflow的有趣问题,并由于我在Spring方面的经验,建议我回答一个很好的问题。 问题是,“ 如何基于使用批注在REST中创建资源的用户来授权特定资源 。” 要点是: 我正…

如何卸载linux中的docker,linux centos7 安装、卸载docker

docker安装1:查看系统版本cat /etc/redhat-releaseCentOS Linux release 7.4.1708 (Core)2:安装docker(yum方式)$ yum install docker3:查看是否安装成功$docker version若输出以下,说明安装成功Client:Version: 1.12.6API version: …

html页面中Location对象跳转页面用法

姓名&#xff1a;<input name"name"/></br> 薪水&#xff1a;<input name"salary"/></br> 年龄&#xff1a;<input name"age"/></br> <input type"submit" value"确认"/></br…

java orm框架有哪些_Java Stream ORM现在带有JOIN

java orm框架有哪些Speedment是一个Java Stream ORM工具包和运行时&#xff0c;它使您可以将数据库表作为标准Java Streams查看。 由于不必混合使用Java和SQL&#xff0c;因此该应用程序变得更加紧凑&#xff0c;从而使其开发速度更快&#xff0c;更不容易出错并且易于维护。 流…

linux pdb创建表空间,ORACLE12C PDB创建默认表空间和用户语句(示例代码)

第一次接触到12C CDB和PDB数据库&#xff0c;且客户提供的是ORACLE一体机&#xff0c;只有访问权&#xff0c;费劲周折&#xff0c;今记录12C创建默认路径表空间语句和用户--创建默认表空间&#xff1a;create tablespace tablesapce_name datafile size 500M autoextend on …

用户在页面输入的中文数据,servlet如何获得正确的中文值

public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// 告诉浏览器&#xff0c;返回的是html页面&#xff0c;而且是以utf-8编码的response.setContentType("text/html;charsetutf-8");//reques…

java编写排序的代码_在Java 8之前,您编写了几行代码来对对象集合进行排序?...

java编写排序的代码在Java 8之前&#xff0c;您编写了几行代码来对对象集合进行排序&#xff1f; Java 8您需要多少个&#xff1f; 您可以在Java 8中用一行完成。 让我们看看下面的Employee类。 public class Employee {private String name;private Integer age;public Emp…

java全局变量和局部变量_Java 10 –局部变量类型推断

java全局变量和局部变量在本文中&#xff0c;我们将看到作为JEP 286的一部分提出的名为Local Variable Type Inference的Java10功能。 从Java的第一个版本开始&#xff0c;它是一种强类型化的语言&#xff0c;我们需要提及每种变量数据类型。 我们都感到Java是冗长的语言&#…

JS_Java_Oracle_MySQL截取字符串的函数

JS 截取字符串 函数 substring(indexStart, indexEnd)&#xff1a; function f1() {var s abcd;// 字符串的字符下标从0开始&#xff0c;从下标为2的字符c开始截取&#xff0c;截取到下标为3的字符d为止&#xff0c;含头不含尾&#xff0c;所以字符d没有被截取&#xff0c;最…

linux安装meld rpm,Linux meld安装

meld是一款图形化的文本比较工具&#xff0c;该工具在windows与linux平台下均有对应版本&#xff0c;最新版本为3.14.2&#xff0c;附上下载地址http://meldmerge.org/meldmeld相较diff命令其输出结果更加直观&#xff0c;因此在linux下使用该工具进行程序源码的比较。忘了说了…

linux注册平台驱动,关于Linux驱动的平台注册方式-- platform_driver_register

http://hi.baidu.com/deep_pro/blog/item/754f7764b73099fbf636544a.htmlcdev_add 、register_blkdev 这样的驱动注册函数platform_driver_register这样的写法&#xff0c;但是没有看到哪本书介绍了相关内容简要说&#xff0c;使用这种方式&#xff0c;可以轻松的实现device和d…

JDBC连接Oracle数据库的参数配置

Oracle 的连接 URL 字符串&#xff1a;jdbc:oracle:thin:host:port:sid 在数据库配置文件 db_oracle.properties 的配置字段如下&#xff1a; urljdbc:oracle:thin:localhost:1521:orcl dbUserlwx dbPassword123456 driverNameoracle.jdbc.OracleDriver

jdk 1.8 字符串+_JDK 9/10/11:Java字符串上+ =的副作用

jdk 1.8 字符串问题“ 为什么array [i &#xff05;n] i ”在Java 8和Java 10中给出不同的结果&#xff1f; ”已于本周初发布在StackOverflow.com上 。 它指出JDK9和更高版本中存在的Java编译器中的错误 &#xff0c;但JDK8中不存在。 如StackOverflow线程上所述&#xff0…

IntelliJ IDEA for Mac 如何设置字体和字号

按组合键 Command , 打开偏好设置窗口&#xff0c;在左侧菜单导航栏找到 Editor --> Font&#xff0c;如下图所示&#xff1a;

vs mono linux,[.NET][C#.NET]走跳在Linux的人生(八).NET Core与Mono执行

8种机械键盘轴体对比本人程序员&#xff0c;要买一个写代码的键盘&#xff0c;请问红轴和茶轴怎么选&#xff1f;我们来试试用.NET Core从Windows环境开发&#xff0c;然后porting到Linux环境(布署及执行.NET Core)&#xff0c;之前曾看过stackoverflow文章提到Mono的性能问题&…

java char类型空值_展望Java的未来:空值类型

java char类型空值尽管有前途的Java值类型不是迫在眉睫&#xff0c;但我偶尔还是喜欢在OpenJDK valhalla-dev邮件列表中打听一下&#xff0c;以了解事情的进展情况并了解即将发生的事情。 诚然&#xff0c;由于我对所用术语的了解有限&#xff0c;并且其中某些消息的底层细节&a…

IntelliJ IDEA 如何设置编辑窗口的背景图片

按下组合键 Shift Command A&#xff0c;打开查找动作的窗口&#xff0c;在输入框中输入 set Background Image&#xff0c;然后选中它&#xff0c;如下图所示&#xff1a; 背景图片设置窗口如下所示&#xff1a;

2013下半年福建高等学校非计算机专业学生计算机二级c语言原题,2013年福建省计算机二级c语言真题及答案(填空题部分)...

1、程序Ccon441.c的功能是&#xff1a;从键盘输入一个直角三角形的两条直角边a和b&#xff0c;计算并输出其周长和面积。将程序填写完整。#include#includevoid main(){double a,b,c,circle,area;printf("Input 2 edges:");scanf(/**/ "%lf %lf" /**/,&…

spring boot示例_Spring Boot完成示例

spring boot示例这篇文章提供了一个使用Spring Boot开发松耦合的REST服务的完整示例。 使用spring boot&#xff0c;我们可以开发可独立运行的生产就绪的Java应用程序&#xff0c;使其成为独立的应用程序&#xff0c;它具有最小的依赖关系并且与其他应用程序的耦合较少。 大多数…