名称:
       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)  设备名

pmap -d 1

pmap -d 1 -q 不显示头尾

[root@C44 ~]#  while true; do pmap -d  3066 | tail -1; sleep 2; done  循环显示进程3066的设备格式的最后1行,间隔2秒,

最后一行的值
mapped 表示该进程映射的虚拟地址空间大小,也就是该进程预先分配的虚拟内存大小,即ps出的vsz
writeable/private  表示进程所占用的私有地址空间大小,也就是该进程实际使用的内存大小     
shared 表示进程和其他进程共享的内存大小

[root@-shiyan bin]# pmap -x
: sshd: root@pts/
Address Kbytes RSS Dirty Mode Mapping
00007f979d216000 rw--- [ anon ]
00007f979d3a0000 rw-s- zero (deleted)
00007f979d4e0000 r-x-- pam_limits.so
00007f979d4e4000 ----- pam_limits.so
00007f979d6e3000 r---- pam_limits.so
00007f979d6e4000 rw--- pam_limits.so
00007f979d6e5000 r-x-- pam_keyinit.so [root@-shiyan bin]# pmap -d
: sshd: root@pts/
Address Kbytes Mode Offset Device Mapping
00007f979d216000 rw--- : [ anon ]
00007f979d3a0000 rw-s- : zero (deleted)
00007f979d4e0000 r-x-- 0fd: pam_limits.so
00007f979d4e4000 ----- 0fd: pam_limits.so

[root@221-comecs ~]# watch -d -n 1 'ss -n|grep 10001'

15:19:16 23 ~:#uptime
 15:28:15 up 38 days,  3:57,  2 users,  load average: 0.00, 0.00, 0.00

snice与skill是一对,pgrep与pkill是一对

pgrep, pkill - look up or signal processes based on name and other attributes

pgrep根据用户名,命令名或者其它属性过滤出pid,非常方便,pkill发送相应的信号

[root@109-com1 bin]# pgrep F
26195
root     26195     1  4 Jul23 pts/2    01:00:28 /usr/local/ps/bin/FLTService

15:31:39 25 ~:#ldd /usr/bin/uptime
        linux-vdso.so.1 =>  (0x00007fff291ff000)
        libproc-3.2.8.so => /lib64/libproc-3.2.8.so (0x00007f2a52250000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f2a51ebc000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2a5247a000)
15:31:52 26 ~:#ldd /usr/bin/w
        linux-vdso.so.1 =>  (0x00007fffd8326000)
        libproc-3.2.8.so => /lib64/libproc-3.2.8.so (0x00007f4f54789000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f4f543f5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f4f549b3000)
15:32:15 27 ~:#ldd /usr/bin/vmstat
        linux-vdso.so.1 =>  (0x00007fff029ff000)
        libproc-3.2.8.so => /lib64/libproc-3.2.8.so (0x00007fbf227d6000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fbf22442000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fbf22a00000)

procps相关工具都调用同一个库

[oracle@localhost ~]$ rpm -ql procps
/bin/ps
/lib64/libproc-3.2.8.so
/lib64/libproc.so
/sbin/sysctl
/usr/bin/free
/usr/bin/pgrep
/usr/bin/pkill
/usr/bin/pmap
/usr/bin/pwdx
/usr/bin/skill
/usr/bin/slabtop
/usr/bin/snice
/usr/bin/tload
/usr/bin/top
/usr/bin/uptime
/usr/bin/vmstat
/usr/bin/w
/usr/bin/watch

linux包之procps之pmap命令的更多相关文章

  1. linux包之procps之sysctl命令

    概述 [root@localhost ~]# rpm -qf /sbin/sysctlprocps-3.2.8-25.el6.x86_64 我们常常在 Linux 的 /proc/sys 目录下,手动 ...

  2. linux包之procps之vmstat命令

    概述 [root@localhost ~]# rpm -qf /usr/bin/vmstatprocps-3.2.8-25.el6.x86_64 vmstat是一个很全面的性能分析工具,可以观察到系统 ...

  3. linux包之bash之内置命令ulimit

    概述 [root@localhost ~]# rpm -qa|grep bashbash-4.1.2-15.el6_4.x86_64 linux limits.conf 配置 limits.conf ...

  4. linux包之iproute之ss命令

    概述 [root@localhost ~]# rpm -qa|grep iprouteiproute-2.6.32-31.el6.x86_64 当服务器的socket连接数量变得非常大时,无论是使用n ...

  5. #linux包之tcpdump之tcpdump命令

    概述 man tcpdump 已阅 yum install tcpdump Downloading Packages:(1/2): libpcap-1.4.0-1.20130826git2dbcaa1 ...

  6. linux包之gdb之gdb命令与core文件产生

    gdb-7.2-64.el6_5.2.x86_64/usr/bin/gcore/usr/bin/gdb/usr/bin/gdb-add-index/usr/bin/gdbtui/usr/bin/gst ...

  7. linux包之iproute之ip命令

    [root@localhost ~]# rpm -qf /sbin/ipiproute-2.6.32-31.el6.x86_64ip 是个命令, ip 命令的功能很多!基本上它整合了 ifconfig ...

  8. linux包之procps之ps与top

    概述 阅读man ps页,与man top页,最权威与标准,也清楚 有时候系统管理员可能只关心现在系统中运行着哪些程序,而不想知道有哪些进程在运行.由于一个应用程序可能需要启动多个进程.所以在同等情况 ...

  9. linux包之sysstat之sar命令

    要启动SAR,必须通过cron工具以周期性的间隔启动.安装sysstat包后,默认创建一个/etc/cron.d/sysstat文件,其默认内容为:# run system activity acco ...

随机推荐

  1. selectors实现高并发

    1. 下面的例子,客户端给服务端发送消息,服务端把消息返回 server #!/usr/bin/env python import selectors import socket import tim ...

  2. BZOJ 1042 硬币购物

    先不考虑限制,那么有dp[i]表示i元钱的方案数. 然后考虑限制,发现可以容斥. 其实整个题就是两个容斥原理.感觉出的蛮好的. #include<iostream> #include< ...

  3. iOS 静态库和动态库的区别&静态库的生成

    linux中静态库和动态库的区别 一.不同 库从本质上来说是一种可执行代码的二进制格式,可以被载入内存中执行.库分静态库和动态库两种. 1. 静态函数库 这类库的名字一般是libxxx.a:利用静态函 ...

  4. InitGoogleLogging坑爹

    google::InitGoogleLogging(argv[0]);    //::google::InitGoogleLogging(argv[0]); 加上这句,竟然没有日志

  5. C# 控件聚焦

    /********************************************************************** * C# 控件聚焦 * 说明: * 做界面经常需要将ta ...

  6. 【题解】【数组】【Leetcode】Merge Sorted Array

    Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume th ...

  7. Spark读取HDFS文件,文件格式为GB2312,转换为UTF-8

    package iie.udps.example.operator.spark; import scala.Tuple2; import org.apache.hadoop.conf.Configur ...

  8. Core Java Volume I — 4.1. Introduction to Object-Oriented Programming

    4.1. Introduction to Object-Oriented ProgrammingObject-oriented programming, or OOP for short, is th ...

  9. SpringMVC 产品笔记

    假设我是springMVC的产品经理,我会怎么做? 恩,题目太大,能力不够,缓一缓. http://jinnianshilongnian.iteye.com/category/231099 http: ...

  10. hdu 4253 Two Famous Companies BZOJ 2654 tree

    [题意]:给出n个点,m条边,边分为两种,一种是A公司的,一种是B公司的.边上有权值,问用n-1条边把n个点连起来的最小费用是多少,其中A公司的边刚好有k条.题目保证有解. 思路:我们发现,如果我们给 ...