简介
pmap是一款对进程内存占用率进行分析的Linux环境调试工具,他提供了进程的内存映射,可以用于显示一个或多个进程的内存状态。
pmap工具使用说明
Usage:
pmap [options] PID [PID ...]
Options:
-x, --extended show details
-X show even more details
WARNING: format changes according to /proc/PID/smaps
-XX show everything the kernel provides
-c, --read-rc read the default rc
-C, --read-rc-from=<file> read the rc from file
-n, --create-rc create new default rc
-N, --create-rc-to=<file> create new rc to file
NOTE: pid arguments are not allowed with -n, -N
-d, --device show the device format
-q, --quiet do not display header and footer
-p, --show-path show path in the mapping
-A, --range=<low>[,<high>] limit results to the given range
-h, --help display this help and exit
-V, --version output version information and exit
使用示例
获取应用程序内存映射详细情况
wzx@wzx-PC:~/Desktop$ pmap -x 1989
1989: /usr/bin/pipewire-media-session
Address Kbytes RSS Dirty Mode Mapping
0000000000400000 12 0 0 r---- pipewire-media-session
0000000000403000 304 0 0 r-x-- pipewire-media-session
000000000044f000 212 0 0 r---- pipewire-media-session
0000000000484000 4 4 4 r---- pipewire-media-session
0000000000485000 4 0 0 rw--- pipewire-media-session
0000000001e2e000 416 0 0 rw--- [ anon ]
00007fb404000000 132 0 0 rw--- [ anon ]
00007fb404021000 65404 0 0 ----- [ anon ]
00007fb408c88000 16 0 0 r---- libudev.so.1.7.3
00007fb408c8c000 108 108 0 r-x-- libudev.so.1.7.3
00007fb408ca7000 40 0 0 r---- libudev.so.1.7.3
00007fb408cb1000 4 0 0 ----- libudev.so.1.7.3
00007fb408cb2000 4 0 0 r---- libudev.so.1.7.3
00007fb408cb3000 4 0 0 rw--- libudev.so.1.7.3
00007fb408ce8000 8 0 0 r---- libspa-v4l2.so
00007fb408cea000 72 0 0 r-x-- libspa-v4l2.so
00007fb408cfc000 16 0 0 r---- libspa-v4l2.so
00007fb408d00000 4 0 0 r---- libspa-v4l2.so
00007fb408d01000 4 0 0 rw--- libspa-v4l2.so
00007fb408d02000 8 0 0 r---- libpipewire-module-rtkit.so
00007fb408d04000 8 0 0 r-x-- libpipewire-module-rtkit.so
00007fb408d06000 4 0 0 r---- libpipewire-module-rtkit.so
00007fb408d07000 4 0 0 r---- libpipewire-module-rtkit.so
00007fb408d08000 4 0 0 rw--- libpipewire-module-rtkit.so
00007fb408d09000 16 0 0 r---- libpipewire-module-session-manager.so
00007fb408d0d000 188 0 0 r-x-- libpipewire-module-session-manager.so
00007fb408d3c000 28 0 0 r---- libpipewire-module-session-manager.so
00007fb408d43000 4 0 0 ----- libpipewire-module-session-manager.so
00007fb408d44000 8 0 0 r---- libpipewire-module-session-manager.so
00007fb408d46000 4 0 0 rw--- libpipewire-module-session-manager.so
00007fb408d47000 8 0 0 r---- libpipewire-module-metadata.so
00007fb408d49000 28 0 0 r-x-- libpipewire-module-metadata.so
00007fb408d50000 8 0 0 r---- libpipewire-module-metadata.so
00007fb408d52000 4 0 0 ----- libpipewire-module-metadata.so
00007fb408d53000 4 0 0 r---- libpipewire-module-metadata.so
00007fb408d54000 4 0 0 rw--- libpipewire-module-metadata.so
00007fb408d55000 28 0 0 r---- libpipewire-module-adapter.so
00007fb408d5c000 16 0 0 r-x-- libpipewire-module-adapter.so
00007fb408d60000 20 0 0 r---- libpipewire-module-adapter.so
00007fb408d65000 4 0 0 ----- libpipewire-module-adapter.so
00007fb408d66000 24 0 0 r---- libpipewire-module-adapter.so
00007fb408d6c000 4 0 0 rw--- libpipewire-module-adapter.so
00007fb408d6d000 8 0 0 r---- libpipewire-module-client-device.so
00007fb408d6f000 36 0 0 r-x-- libpipewire-module-client-device.so
00007fb408d78000 8 0 0 r---- libpipewire-module-client-device.so
00007fb408d7a000 4 0 0 ----- libpipewire-module-client-device.so
00007fb408d7b000 4 0 0 r---- libpipewire-module-client-device.so
00007fb408d7c000 4 0 0 rw--- libpipewire-module-client-device.so
00007fb408d7d000 44 0 0 r---- libpipewire-module-client-node.so
00007fb408d88000 152 0 0 r-x-- libpipewire-module-client-node.so
00007fb408dae000 48 0 0 r---- libpipewire-module-client-node.so
00007fb408dba000 36 0 0 r---- libpipewire-module-client-node.so
00007fb408dc3000 4 0 0 rw--- libpipewire-module-client-node.so
00007fb408dc4000 56 0 0 r---- libpipewire-module-protocol-native.so
00007fb408dd2000 128 0 0 r-x-- libpipewire-module-protocol-native.so
00007fb408df2000 44 0 0 r---- libpipewire-module-protocol-native.so
00007fb408dfd000 4 0 0 ----- libpipewire-module-protocol-native.so
00007fb408dfe000 44 0 0 r---- libpipewire-module-protocol-native.so
00007fb408e09000 4 0 0 rw--- libpipewire-module-protocol-native.so
00007fb408e0a000 4 0 0 ----- [ anon ]
00007fb408e0b000 8200 0 0 rw--- [ anon ]
00007fb40960d000 16 16 0 r---- libgpg-error.so.0.26.1
00007fb409611000 76 76 0 r-x-- libgpg-error.so.0.26.1
00007fb409624000 36 36 0 r---- libgpg-error.so.0.26.1
00007fb40962d000 4 0 0 ----- libgpg-error.so.0.26.1
00007fb40962e000 4 0 0 r---- libgpg-error.so.0.26.1
00007fb40962f000 4 0 0 rw--- libgpg-error.so.0.26.1
00007fb409630000 48 48 0 r---- libgcrypt.so.20.2.4
00007fb40963c000 844 64 0 r-x-- libgcrypt.so.20.2.4
00007fb40970f000 244 0 0 r---- libgcrypt.so.20.2.4
00007fb40974c000 4 0 0 ----- libgcrypt.so.20.2.4
00007fb40974d000 8 0 0 r---- libgcrypt.so.20.2.4
00007fb40974f000 20 0 0 rw--- libgcrypt.so.20.2.4
00007fb409754000 12 0 0 rw--- [ anon ]
00007fb409757000 8 4 0 r---- liblz4.so.1.8.3
00007fb409759000 96 56 0 r-x-- liblz4.so.1.8.3
00007fb409771000 12 0 0 r---- liblz4.so.1.8.3
00007fb409774000 4 0 0 r---- liblz4.so.1.8.3
00007fb409775000 4 0 0 rw--- liblz4.so.1.8.3
00007fb409776000 44 8 0 r---- libzstd.so.1.4.8
00007fb409781000 732 64 0 r-x-- libzstd.so.1.4.8
00007fb409838000 72 0 0 r---- libzstd.so.1.4.8
00007fb40984a000 4 0 0 ----- libzstd.so.1.4.8
00007fb40984b000 4 0 0 r---- libzstd.so.1.4.8
00007fb40984c000 4 0 0 rw--- libzstd.so.1.4.8
00007fb40984d000 12 4 0 r---- liblzma.so.5.2.5
00007fb409850000 96 32 0 r-x-- liblzma.so.5.2.5
00007fb409868000 44 0 0 r---- liblzma.so.5.2.5
00007fb409873000 4 0 0 r---- liblzma.so.5.2.5
00007fb409874000 4 0 0 rw--- liblzma.so.5.2.5
00007fb409875000 8 8 0 r---- librt-2.28.so
00007fb409877000 16 16 0 r-x-- librt-2.28.so
00007fb40987b000 8 0 0 r---- librt-2.28.so
00007fb40987d000 4 0 0 r---- librt-2.28.so
00007fb40987e000 4 0 0 rw--- librt-2.28.so
00007fb40987f000 52 52 0 r---- libm-2.28.so
00007fb40988c000 636 252 0 r-x-- libm-2.28.so
00007fb40992b000 852 0 0 r---- libm-2.28.so
00007fb409a00000 4 0 0 r---- libm-2.28.so
00007fb409a01000 4 0 0 rw--- libm-2.28.so
00007fb409a02000 88 4 0 r---- libsystemd.so.0.33.0
00007fb409a18000 500 60 0 r-x-- libsystemd.so.0.33.0
00007fb409a95000 192 0 0 r---- libsystemd.so.0.33.0
00007fb409ac5000 48 0 0 r---- libsystemd.so.0.33.0
00007fb409ad1000 4 0 0 rw--- libsystemd.so.0.33.0
00007fb409ad2000 12 0 0 rw--- [ anon ]
00007fb409ad5000 4 4 0 r---- libdl-2.28.so
00007fb409ad6000 4 4 0 r-x-- libdl-2.28.so
00007fb409ad7000 4 0 0 r---- libdl-2.28.so
00007fb409ad8000 4 0 0 r---- libdl-2.28.so
00007fb409ad9000 4 0 0 rw--- libdl-2.28.so
00007fb409ada000 136 136 0 r---- libc-2.28.so
00007fb409afc000 1312 1156 0 r-x-- libc-2.28.so
00007fb409c44000 304 172 0 r---- libc-2.28.so
00007fb409c90000 4 0 0 ----- libc-2.28.so
00007fb409c91000 16 0 0 r---- libc-2.28.so
00007fb409c95000 8 0 0 rw--- libc-2.28.so
00007fb409c97000 16 0 0 rw--- [ anon ]
00007fb409c9b000 24 24 0 r---- libpthread-2.28.so
00007fb409ca1000 60 60 0 r-x-- libpthread-2.28.so
00007fb409cb0000 24 0 0 r---- libpthread-2.28.so
00007fb409cb6000 4 0 0 r---- libpthread-2.28.so
00007fb409cb7000 4 0 0 rw--- libpthread-2.28.so
00007fb409cb8000 16 0 0 rw--- [ anon ]
00007fb409cbc000 180 180 0 r---- libasound.so.2.0.0
00007fb409ce9000 564 64 0 r-x-- libasound.so.2.0.0
00007fb409d76000 232 0 0 r---- libasound.so.2.0.0
00007fb409db0000 32 0 0 r---- libasound.so.2.0.0
00007fb409db8000 4 0 0 rw--- libasound.so.2.0.0
00007fb409db9000 52 52 0 r---- libdbus-1.so.3.19.13
00007fb409dc6000 184 184 0 r-x-- libdbus-1.so.3.19.13
00007fb409df4000 84 32 0 r---- libdbus-1.so.3.19.13
00007fb409e09000 8 4 4 r---- libdbus-1.so.3.19.13
00007fb409e0b000 4 0 0 rw--- libdbus-1.so.3.19.13
00007fb409e0c000 136 0 0 r---- libpipewire-0.3.so.0.315.0
00007fb409e2e000 280 0 0 r-x-- libpipewire-0.3.so.0.315.0
00007fb409e74000 104 0 0 r---- libpipewire-0.3.so.0.315.0
00007fb409e8e000 112 0 0 r---- libpipewire-0.3.so.0.315.0
00007fb409eaa000 4 0 0 rw--- libpipewire-0.3.so.0.315.0
00007fb409eab000 44 0 0 rw--- [ anon ]
00007fb409eb6000 12 0 0 r---- libnss_files-2.28.so
00007fb409eb9000 28 0 0 r-x-- libnss_files-2.28.so
00007fb409ec0000 8 0 0 r---- libnss_files-2.28.so
00007fb409ec2000 4 0 0 ----- libnss_files-2.28.so
00007fb409ec3000 4 0 0 r---- libnss_files-2.28.so
00007fb409ec4000 4 0 0 rw--- libnss_files-2.28.so
00007fb409ec5000 24 0 0 rw--- [ anon ]
00007fb409ecb000 4 0 0 r---- libspa-dbus.so
00007fb409ecc000 8 0 0 r-x-- libspa-dbus.so
00007fb409ece000 4 0 0 r---- libspa-dbus.so
00007fb409ecf000 4 0 0 r---- libspa-dbus.so
00007fb409ed0000 4 0 0 rw--- libspa-dbus.so
00007fb409ed1000 8 0 0 r---- libspa-support.so
00007fb409ed3000 64 0 0 r-x-- libspa-support.so
00007fb409ee3000 16 0 0 r---- libspa-support.so
00007fb409ee7000 4 0 0 ----- libspa-support.so
00007fb409ee8000 4 0 0 r---- libspa-support.so
00007fb409ee9000 4 0 0 rw--- libspa-support.so
00007fb409eea000 4 4 0 r---- ld-2.28.so
00007fb409eeb000 120 120 0 r-x-- ld-2.28.so
00007fb409f09000 32 28 0 r---- ld-2.28.so
00007fb409f11000 4 0 0 r---- ld-2.28.so
00007fb409f12000 4 0 0 rw--- ld-2.28.so
00007fb409f13000 4 4 4 rw--- [ anon ]
00007ffe1d2f7000 132 4 4 rw--- [ stack ]
00007ffe1d377000 16 0 0 r---- [ anon ]
00007ffe1d37b000 8 4 0 r-x-- [ anon ]
ffffffffff600000 4 0 0 --x-- [ anon ]
---------------- ------- ------- -------
total kB 85432 3148 16
内存格式信息
- Address:内存开始地址
- Kbytes:占用的字节数(KB)
- RSS:占用的物理内存空间(包含共享库占有的全部内存,它表示该进程所使用的所有共享库的大小,不管有多少个进程使用该共享库,该共享库仅被加载到内存一次)(KB)
- Dirty:脏页的字节数
- Mode:内存的权限
- Mapping:占用内存的文件
aarch64架构下rpm包:
https://mirrors.aliyun.com/openeuler/openEuler-20.03-LTS/everything/aarch64/Packages/
procps-ng-3.3.16-11.oe1.aarch64.rpm
标签:---,--,libpipewire,module,----,so,内存,pmap,Linux From: https://www.cnblogs.com/Wangzx000/p/17270643.html