Linux pmap命令:报告进程的内存映射。
Linux pmap命令 功能描述
使用pmap命令可以报告进程的内存映射。
Linux pmap命令 语法
pmap [选项] [进程PID]
命令中各选项的含义如表所示。
Linux pmap命令 示例
报告进程45202的内存映射
[root@rhel ~]# pmap 45202
45202: /bin/bash/sbin/pppoe-setup
0000000000400000 848K r-x-- /bin/bash
00000000006d3000 40K rw--- /bin/bash
00000000006dd000 20K rw--- [anon]
00000000008dc000 36K rw--- /bin/bash
000000000122a000 264K rw--- [anon]
00000037fa400000 128K r-x-- /lib64/ld-2.12.so
00000037fa61f000 4K r---- /lib64/ld-2.12.so
00000037fa620000 4K rw--- /lib64/ld-2.12.so
00000037fa621000 4K rw--- [anon]
00000037fa800000 8K r-x-- /lib64/libdl-2.12.so
00000037fa802000 2048K----- /lib64/libdl-2.12.so
00000037faa02000 4K r---- /lib64/libdl-2.12.so
00000037faa03000 4K rw--- /lib64/libdl-2.12.so
00000037fac00000 1576K r-x-- /lib64/libc-2.12.so
00000037fad8a000 2044K----- /lib64/libc-2.12.so
00000037faf89000 16K r---- /lib64/libc-2.12.so
00000037faf8d000 4K rw--- /lib64/libc-2.12.so
00000037faf8e000 20K rw--- [anon]
0000003809000000 116K r-x-- /lib64/libtinfo.so.5.7
000000380901d000 2048K----- /lib64/libtinfo.so.5.7
000000380921d000 16K rw--- /lib64/libtinfo.so.5.7
00007fb977fa4000 96832K r---- /usr/lib/locale/locale-archive
00007fb97de34000 12K rw--- [anon]
00007fb97de63000 4K rw--- [anon]
00007fb97de64000 28K r--s- /usr/lib64/gconv/gconv-modules.cache
00007fb97de6b000 4K rw--- [anon]
00007fffe7fd6000 84K rw--- [stack]
00007fffe7fff000 4K r-x-- [anon]
ffffffffff600000 4K r-x-- [anon]
total 106224K
报告进程45202的内存映射,以扩展格式显示
[root@rhel ~]# pmap -x 45202
45202: /bin/bash/sbin/pppoe-setup
Address Kbytes RSS Dirty Mode Mapping
0000000000400000 848 428 0 r-x-- bash
00000000006d3000 40 20 20 rw--- bash
00000000006dd000 20 20 20 rw--- [anon]
00000000008dc000 36 8 0 rw--- bash
000000000122a000 264 140 140 rw--- [anon]
00000037fa400000 128 104 0 r-x-- ld-2.12.so
00000037fa61f000 4 4 4 r---- ld-2.12.so
00000037fa620000 4 4 4 rw--- ld-2.12.so
00000037fa621000 4 4 4 rw--- [anon]
00000037fa800000 8 8 0 r-x-- libdl-2.12.so
00000037fa802000 2048 0 0----- libdl-2.12.so
00000037faa02000 4 4 4 r---- libdl-2.12.so
00000037faa03000 4 4 4 rw--- libdl-2.12.so
00000037fac00000 1576 480 0 r-x-- libc-2.12.so
00000037fad8a000 2044 0 0----- libc-2.12.so
00000037faf89000 16 16 4 r---- libc-2.12.so
00000037faf8d000 4 4 4 rw--- libc-2.12.so
00000037faf8e000 20 12 12 rw--- [anon]
0000003809000000 116 20 0 r-x-- libtinfo.so.5.7
000000380901d000 2048 0 0----- libtinfo.so.5.7
000000380921d000 16 12 4 rw--- libtinfo.so.5.7
00007fb977fa4000 96832 40 0 r---- locale-archive
00007fb97de34000 12 12 12 rw--- [anon]
00007fb97de63000 4 4 4 rw--- [anon]
00007fb97de64000 28 20 0 r--s- gconv-modules.cache
00007fb97de6b000 4 4 4 rw--- [anon]
00007fffe7fd6000 84 32 32 rw--- [stack]
00007fffe7fff000 4 4 0 r-x-- [anon]
ffffffffff600000 4 0 0 r-x-- [anon]
---------------- ------ ------ ------
total kB 106224 1408 276
报告进程45202的内存映射,并显示设备的格式
[root@rhel ~]# pmap -d 45202
45202: /bin/bash/sbin/pppoe-setup
Address Kbytes Mode Offset Device Mapping
0000000000400000 848 r-x--0000000000000000008:00002 bash
00000000006d3000 40 rw---00000000000d3000008:00002 bash
00000000006dd000 20 rw---0000000000000000000:00000 [anon]
00000000008dc000 36 rw---00000000000dc000008:00002 bash
000000000122a000 264 rw---0000000000000000000:00000 [anon]
00000037fa400000 128 r-x--0000000000000000008:00002 ld-2.12.so
00000037fa61f000 4 r----000000000001f000008:00002 ld-2.12.so
00000037fa620000 4 rw---0000000000020000008:00002 ld-2.12.so
00000037fa621000 4 rw---0000000000000000000:00000 [anon]
00000037fa800000 8 r-x--0000000000000000008:00002 libdl-2.12.so
00000037fa802000 2048-----0000000000002000008:00002 libdl-2.12.so
00000037faa02000 4 r----0000000000002000008:00002 libdl-2.12.so
00000037faa03000 4 rw---0000000000003000008:00002 libdl-2.12.so
00000037fac00000 1576 r-x--0000000000000000008:00002 libc-2.12.so
00000037fad8a000 2044-----000000000018a000008:00002 libc-2.12.so
00000037faf89000 16 r----0000000000189000008:00002 libc-2.12.so
00000037faf8d000 4 rw---000000000018d000008:00002 libc-2.12.so
00000037faf8e000 20 rw---0000000000000000000:00000 [anon]
0000003809000000 116 r-x--0000000000000000008:00002 libtinfo.so.5.7
000000380901d000 2048-----000000000001d000008:00002 libtinfo.so.5.7
000000380921d000 16 rw---000000000001d000008:00002 libtinfo.so.5.7
00007fb977fa4000 96832 r----0000000000000000008:00002 locale-archive
00007fb97de34000 12 rw---0000000000000000000:00000 [anon]
00007fb97de63000 4 rw---0000000000000000000:00000 [anon]
00007fb97de64000 28 r--s-0000000000000000008:00002 gconv-modules.cache
00007fb97de6b000 4 rw---0000000000000000000:00000 [anon]
00007fffe7fd6000 84 rw---0000000000000000000:00000 [stack]
00007fffe7fff000 4 r-x--0000000000000000000:00000 [anon]
ffffffffff600000 4 r-x--0000000000000000000:00000 [anon]
mapped:106224K writeable/private:516K shared:28K