linux学习笔记--pmap命令

来源:互联网 发布:双语字幕制作软件 编辑:程序博客网 时间:2024/06/10 21:05

报告进程的内存映射关系,是linux调试和运维的一个很好的工具

pmap (选项) (参数)

选项:

-x  : 显示扩展格式

-d : 显示设备格式

-q : 不显示头尾行

-V : 显示版本号 

参数:

进程号:指定需要显示内存映射关系的进程号,可以是多个进程号


[root@localhost ~]# pmap -x 11:   /usr/lib/systemd/systemd --switched-root --system --deserialize 21Address           Kbytes     RSS   Dirty Mode  Mapping00007f7eb4000000     164      12      12 rw---   [ anon ]00007f7eb4029000   65372       0       0 -----   [ anon ]00007f7ebb3c9000       4       0       0 -----   [ anon ]00007f7ebb3ca000    8192       8       8 rw---   [ anon ]00007f7ebbbca000       4       0       0 -----   [ anon ]00007f7ebbbcb000    8192       8       8 rw---   [ anon ]00007f7ebc3cb000      16       8       0 r-x-- libuuid.so.1.3.000007f7ebc3cf000    2044       0       0 ----- libuuid.so.1.3.000007f7ebc5ce000       4       4       4 r---- libuuid.so.1.3.000007f7ebc5cf000       4       4       4 rw--- libuuid.so.1.3.000007f7ebc5d0000     224      36       0 r-x-- libblkid.so.1.1.000007f7ebc608000    2048       0       0 ----- libblkid.so.1.1.000007f7ebc808000      12      12      12 r---- libblkid.so.1.1.000007f7ebc80b000       4       4       4 rw--- libblkid.so.1.1.000007f7ebc80c000       4       0       0 rw---   [ anon ]00007f7ebc80d000      84      12       0 r-x-- libz.so.1.2.700007f7ebc822000    2044       0       0 ----- libz.so.1.2.700007f7ebca21000       4       4       4 r---- libz.so.1.2.700007f7ebca22000       4       4       4 rw--- libz.so.1.2.700007f7ebca23000      16       8       0 r-x-- libattr.so.1.1.000007f7ebca27000    2044       0       0 ----- libattr.so.1.1.000007f7ebcc26000       4       4       4 r---- libattr.so.1.1.000007f7ebcc27000       4       4       4 rw--- libattr.so.1.1.000007f7ebcc28000      12       8       0 r-x-- libdl-2.17.so00007f7ebcc2b000    2044       0       0 ----- libdl-2.17.so00007f7ebce2a000       4       4       4 r---- libdl-2.17.so00007f7ebce2b000       4       4       4 rw--- libdl-2.17.so00007f7ebce2c000     144      16       0 r-x-- liblzma.so.5.0.9900007f7ebce50000    2044       0       0 ----- liblzma.so.5.0.9900007f7ebd04f000       4       4       4 r---- liblzma.so.5.0.9900007f7ebd050000       4       4       4 rw--- liblzma.so.5.0.9900007f7ebd051000     384       8       0 r-x-- libpcre.so.1.2.000007f7ebd0b1000    2044       0       0 ----- libpcre.so.1.2.000007f7ebd2b0000       4       4       4 r---- libpcre.so.1.2.000007f7ebd2b1000       4       4       4 rw--- libpcre.so.1.2.000007f7ebd2b2000    1752     660       0 r-x-- libc-2.17.so00007f7ebd468000    2048       0       0 ----- libc-2.17.so00007f7ebd668000      16      16      16 r---- libc-2.17.so00007f7ebd66c000       8       8       8 rw--- libc-2.17.so00007f7ebd66e000      20      12      12 rw---   [ anon ]00007f7ebd673000      88      68       0 r-x-- libpthread-2.17.so00007f7ebd689000    2048       0       0 ----- libpthread-2.17.so00007f7ebd889000       4       4       4 r---- libpthread-2.17.so00007f7ebd88a000       4       4       4 rw--- libpthread-2.17.so00007f7ebd88b000      16       4       4 rw---   [ anon ]00007f7ebd88f000      84      12       0 r-x-- libgcc_s-4.8.5-20150702.so.100007f7ebd8a4000    2044       0       0 ----- libgcc_s-4.8.5-20150702.so.100007f7ebdaa3000       4       4       4 r---- libgcc_s-4.8.5-20150702.so.100007f7ebdaa4000       4       4       4 rw--- libgcc_s-4.8.5-20150702.so.100007f7ebdaa5000      28      16       0 r-x-- librt-2.17.so00007f7ebdaac000    2044       0       0 ----- librt-2.17.so00007f7ebdcab000       4       4       4 r---- librt-2.17.so00007f7ebdcac000       4       4       4 rw--- librt-2.17.so00007f7ebdcad000     244     112       0 r-x-- libmount.so.1.1.000007f7ebdcea000    2044       0       0 ----- libmount.so.1.1.000007f7ebdee9000       4       4       4 r---- libmount.so.1.1.000007f7ebdeea000       4       4       4 rw--- libmount.so.1.1.000007f7ebdeeb000       4       4       4 rw---   [ anon ]00007f7ebdeec000      84      68       0 r-x-- libkmod.so.2.2.1000007f7ebdf01000    2044       0       0 ----- libkmod.so.2.2.1000007f7ebe100000       4       4       4 r---- libkmod.so.2.2.1000007f7ebe101000       4       4       4 rw--- libkmod.so.2.2.1000007f7ebe102000     108      32       0 r-x-- libaudit.so.1.0.000007f7ebe11d000    2048       0       0 ----- libaudit.so.1.0.000007f7ebe31d000       4       4       4 r---- libaudit.so.1.0.000007f7ebe31e000       4       4       4 rw--- libaudit.so.1.0.000007f7ebe31f000      40       4       4 rw---   [ anon ]00007f7ebe329000      52      12       0 r-x-- libpam.so.0.83.100007f7ebe336000    2048       0       0 ----- libpam.so.0.83.100007f7ebe536000       4       4       4 r---- libpam.so.0.83.100007f7ebe537000       4       4       4 rw--- libpam.so.0.83.100007f7ebe538000      16       8       0 r-x-- libcap.so.2.2200007f7ebe53c000    2044       0       0 ----- libcap.so.2.2200007f7ebe73b000       4       4       4 r---- libcap.so.2.2200007f7ebe73c000       4       4       4 rw--- libcap.so.2.2200007f7ebe73d000     132      64       0 r-x-- libselinux.so.100007f7ebe75e000    2048       0       0 ----- libselinux.so.100007f7ebe95e000       4       4       4 r---- libselinux.so.100007f7ebe95f000       4       4       4 rw--- libselinux.so.100007f7ebe960000       8       4       4 rw---   [ anon ]00007f7ebe962000     132     112       0 r-x-- ld-2.17.so00007f7ebeb62000      40      40      40 rw---   [ anon ]00007f7ebeb81000       8       8       8 rw---   [ anon ]00007f7ebeb83000       4       4       4 r---- ld-2.17.so00007f7ebeb84000       4       4       4 rw--- ld-2.17.so00007f7ebeb85000       4       4       4 rw---   [ anon ]00007f7ebeb86000    1304    1120       0 r-x-- systemd00007f7ebeccc000     128     128     128 r---- systemd00007f7ebecec000       4       4       4 rw--- systemd00007f7ec07b3000    1692    1604    1604 rw---   [ anon ]00007ffe90937000     132      52      52 rw---   [ stack ]00007ffe9097c000       8       4       0 r-x--   [ anon ]ffffffffff600000       4       0       0 r-x--   [ anon ]---------------- ------- ------- ------- total kB          123884    4448    2064
Address           Kbytes     RSS   Dirty Mode  Mapping
Address: 映像起始地址

Kbytes: 映像大小

RSS: 驻留集大小

Dirty: 脏页大小

Mode: 映像权限

Mapping: 映像支持文件 anon 为已分配内存 stack 程序堆栈

Offset: 文件偏移

Device: 设备名

0 0