pmap用法小计

By francis_hao    Aug 4,2017

 

pmap-报告进程的内存映射。

 

概要

pmap [options] pid [...]

 

描述

pmap命令用来报告一个或多个进程的内存映射。

 

选项

选项

说明

-x, --extended

显示扩展的信息

-d, --device

显示设备的信息

-q, --quiet

不显示头或脚注

-A, --range low,high

只显示指定范围的地址空间,低地址和高地址分别用low和high指定,以逗号分隔

-X

显示比-x更详细的信息。但是会按照文件/proc/PID/smaps改变显示格式(显示的信息是该文件内容的简化)

-XX

显示一切内核提供的信息

-p, --show-path

显示文件项的全路径

-c, --read-rc

读默认配置(哪里的配置??什么作用?)

-C, --read-rc-from file

从file读配置

-n, --create-rc

新建默认配置

-N, --create-rc-to file

创建配置到file

-h, --help

显示帮助信息并退出

-V, --version

显示版本信息并退出

  

 

示例

1、一个最简单的c程序以静态编译后的pmap

int main(void)
{
    while(1);
    return 0;
}

其中,第一列表示虚拟空间地址,第二列表示该项在虚拟空间中占用的大小,第三列表示权限,第四列表示该项名称(anon是佚名的)。

2、-x选项

3、-d选项    

4、-X选项

名词解释

RSS

resident set size, the non-swapped physical memory that a task has used, (alias rssize, rsz)

PSS

proportional set size, composed by the private memory of that process plus the proportion of shared memory with one or more other processes. Unshared memory including the proportion of shared memory is reported as the PSS

  
  

 

 

 


本文由 刘英皓 创作,采用 知识共享 署名-非商业性使用-相同方式共享 3.0 中国大陆 许可协议进行许可。欢迎转载,请注明出处:
转载自:http://www.cnblogs.com/yinghao1991/p/7287941.html

 

 

参考

【1】博客园 http://www.cnblogs.com/xiaohexiansheng/p/5500870.html gcc static静态编译选项提示错误

【2】CSDN http://blog.csdn.net/adaptiver/article/details/7084364 内存耗用:VSS/RSS/PSS/USS

【2】man pmap

 

原文地址:https://www.cnblogs.com/yinghao-liu/p/7287941.html