Linux性能测试 pmap命令
名称:
pmap - report memory map of a process(查看进程的内存映像信息)
用法
pmap [ -x | -d ] [ -q ] pids...
pmap -V
选项含义
-x extended Show the extended format. 显示扩展格式
-d device Show the device format. 显示设备格式
-q quiet Do not display some header/footer lines. 不显示头尾行
-V show version Displays version of program. 显示版本
扩展格式和设备格式域:
Address: start address of map 映像起始地址
Kbytes: size of map in kilobytes 映像大小
RSS: resident set size in kilobytes 驻留集大小
Dirty: dirty pages (both shared and private) in kilobytes 脏页大小
Mode: permissions on map 映像权限: r=read, w=write, x=execute, s=shared, p=private (copy on write)
Mapping: file backing the map , or '[ anon ]' for allocated memory, or '[ stack ]' for the program stack. 映像支持文件,[anon]为已分配内存 [stack]为程序堆栈
Offset: offset into the file 文件偏移
Device: device name (major:minor) 设备名
举例:
查看进程1的设备格式
[root@C44 ~]# pmap -d
: init []
Address Kbytes Mode Offset Device Mapping
r-x-- : ld-2.3..so
0094a000 r---- : ld-2.3..so
0094b000 rw--- : ld-2.3..so
0094e000 r-x-- : libc-2.3..so
00a77000 r---- : libc-2.3..so
00a79000 rw--- 000000000012b000 : libc-2.3..so
00a7b000 rw--- 0000000000a7b000 : [ anon ]
00a85000 r-x-- : libsepol.so.
00a92000 rw--- 000000000000c000 : libsepol.so.
00a93000 rw--- 0000000000a93000 : [ anon ]
00d9d000 r-x-- : libselinux.so.
00daa000 rw--- 000000000000d000 : libselinux.so.
r-x-- : init
0804f000 rw--- : init
084e1000 rw--- 00000000084e1000 : [ anon ]
b7f5d000 rw--- 00000000b7f5d000 : [ anon ]
bffee000 rw--- 00000000bffee000 : [ stack ]
ffffe000 ----- : [ anon ]
mapped: 1700K writeable/private: 276K shared: 0K
[root@C44 ~]#
最后一行的值
mapped 表示该进程映射的虚拟地址空间大小,也就是该进程预先分配的虚拟内存大小,即ps出的vsz
writeable/private 表示进程所占用的私有地址空间大小,也就是该进程实际使用的内存大小
shared 表示进程和其他进程共享的内存大小
查看进程1的设备格式,不显示头尾行
[root@C44 ~]# pmap -d -q
: init []
r-x-- : ld-2.3..so
0094a000 r---- : ld-2.3..so
0094b000 rw--- : ld-2.3..so
0094e000 r-x-- : libc-2.3..so
00a77000 r---- : libc-2.3..so
00a79000 rw--- 000000000012b000 : libc-2.3..so
00a7b000 rw--- 0000000000a7b000 : [ anon ]
00a85000 r-x-- : libsepol.so.
00a92000 rw--- 000000000000c000 : libsepol.so.
00a93000 rw--- 0000000000a93000 : [ anon ]
00d9d000 r-x-- : libselinux.so.
00daa000 rw--- 000000000000d000 : libselinux.so.
r-x-- : init
0804f000 rw--- : init
084e1000 rw--- 00000000084e1000 : [ anon ]
b7f5d000 rw--- 00000000b7f5d000 : [ anon ]
bffee000 rw--- 00000000bffee000 : [ stack ]
ffffe000 ----- : [ anon ]
[root@C44 ~]#
查看进程1的扩展格式
[root@C44 ~]# pmap -x
: init []
Address Kbytes RSS Anon Locked Mode Mapping
- - - r-x-- ld-2.3..so
0094a000 - - - r---- ld-2.3..so
0094b000 - - - rw--- ld-2.3..so
0094e000 - - - r-x-- libc-2.3..so
00a77000 - - - r---- libc-2.3..so
00a79000 - - - rw--- libc-2.3..so
00a7b000 - - - rw--- [ anon ]
00a85000 - - - r-x-- libsepol.so.
00a92000 - - - rw--- libsepol.so.
00a93000 - - - rw--- [ anon ]
00d9d000 - - - r-x-- libselinux.so.
00daa000 - - - rw--- libselinux.so.
- - - r-x-- init
0804f000 - - - rw--- init
084e1000 - - - rw--- [ anon ]
b7f5d000 - - - rw--- [ anon ]
bffee000 - - - rw--- [ stack ]
ffffe000 - - - ----- [ anon ]
-------- ------- ------- ------- -------
total kB - - -
[root@C44 ~]#
循环显示进程3066的设备格式的最后1行,间隔2秒,
[root@C44 ~]# while true; do pmap -d | tail -; sleep ; done
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
mapped: 5412K writeable/private: 2028K shared: 0K
Linux性能测试 pmap命令的更多相关文章
- [转帖]Linux性能测试 pmap命令
Linux性能测试 pmap命令 https://www.cnblogs.com/txw1958/archive/2012/07/26/linux-pmap.html 名称: pmap - ...
- 【转】linux之pmap命令!
原贴:http://tonykorn97.itpub.net/post/6414/249221 linux之pmap命令! ====================================== ...
- Linux性能测试分析命令_top
top命令动态展示系统整体资源和各个进程资源占用状况,是Linux下常用的性能分析工具. top命令语法 使用格式:top [-] [d] [b] [H] [p] [q] [c] [C] [S] [s ...
- Linux性能测试分析命令_sar+iostat+vmstat+top
sar主要用于收集并统计系统资源的信息,包括CPU.IO.内存.网卡流量等. vmstat命令主要是对操作系统的虚拟内存.进程.IO读写.CPU活动等整体情况进行统计.但是它不能对某个进程进行深入分析 ...
- Linux性能测试分析命令_vmstat
vmstat命令主要是对操作系统的虚拟内存.进程.IO读写.CPU活动等整体情况进行统计.但是它不能对某个进程进行深入分析. vmstat基本语法 命令使用格式:vmstat [options] [d ...
- Linux性能测试 tcpdump命令
用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具. tcpdump可以将网络中传送的数据包的“头” ...
- Linux性能测试 netstat命令
功能说明:Netstat用于显示与IP.TCP.UDP和ICMP协议相关的统计数据,一般用于检验本机各端口的网络连接情况.语 法:netstat [-acCeFghilMnNoprstuvVwx][- ...
- Linux性能测试 mpstat命令
mpstat是MultiProcessor Statistics的缩写,是实时系统监控工具.其报告与CPU的一些统计信息,这些信息存放在/proc/stat文件中.在多CPUs系统里,其不但能查看所有 ...
- Linux性能测试 sar命令
sar命令包含在sysstat工具包中,提供系统的众多统计数据.其在不同的系统上命令有些差异 sar 命令行的常用格式: [root@C44 ~]# sar sysstat version (C) S ...
随机推荐
- 【record】11.14..11.20
balabala
- [Angular2 Animation] Delay and Ease Angular 2 Animations
By default, transitions will appear linearly over time, but proper animations have a bit more custom ...
- Python中字符串的解压缩
今天在用Streaming-Python处理一个MapReduce程序时,发现reducer失败,原由于耗费内存达到极限了.细致查看代码时,发现有一个集合里保存着URL,而URL长度是比較长的,直接保 ...
- Helloworld之Spring依赖注入/控制反转(DI/IoC)版
Helloworld之Spring依赖注入/控制反转(DI/IoC)版 作者:雨水, 日期:2014-10-29 摘要:本文主要用于培训刚開始学习的人理解Spring中的依赖注入的基本概念. 先介绍依 ...
- 贝叶斯统计(Bayesian statistics) vs 频率统计(Frequentist statistics):marginal likelihood(边缘似然)
1. Bayesian statistics 一组独立同分布的数据集 X=(x1,-,xn)(xi∼p(xi|θ)),参数 θ 同时也是被另外分布定义的随机变量 θ∼p(θ|α),此时: p(X|α) ...
- MyCAT分表初体验
1.mycat二进制包安装 下载地址:http://dl.mycat.io/ tar -zxvf Mycat-server-1.6.5-release-20180122220033-linux.tar ...
- ios开发网络学习十二:NSURLSession实现文件上传
#import "ViewController.h" // ----WebKitFormBoundaryvMI3CAV0sGUtL8tr #define Kboundary @&q ...
- 使用LAMP创建基于wordpress的个从博客网站 分类: B3_LINUX 2014-07-15 16:45 800人阅读 评论(0) 收藏
参考: http://blog.csdn.net/ck_boss/article/details/27866117 一.mysql配置 1.安装mysql yum install mysql-serv ...
- 使用URLConnection获取网页信息的基本流程 分类: H1_ANDROID 2013-10-12 23:51 3646人阅读 评论(0) 收藏
参考自core java v2, chapter3 Networking. 注:URLConnection的子类HttpURLConnection被广泛用于Android网络客户端编程,它与apach ...
- 百度echarts可以做什么
百度echarts可以做什么 一.总结 一句话总结:可视化做的很好,各种图都有.而且支持动态数据. 二.百度eCharts体验 前言 从昨天开始给项目里添加一些图表对比功能,上一个项目里使用的是Hig ...