pmap -x [PROCESS ID]
e.g.:
[root@ ~]# pmap -x 19771
19771: nginx: worker process
Address Kbytes RSS Dirty Mode Mapping
0000000000400000 668 420 0 r-x-- nginx
00000000006a6000 56 56 52 rw--- nginx
00000000006b4000 60 16 16 rw--- [ anon ]
000000000f4c4000 1468 1080 1080 rw--- [ anon ]
00000034f3c00000 112 40 0 r-x-- ld-2.5.so
00000034f3e1b000 4 4 4 r---- ld-2.5.so
00000034f3e1c000 4 4 4 rw--- ld-2.5.so
00000034f4000000 1336 280 0 r-x-- libc-2.5.so
00000034f414e000 2044 0 0 ----- libc-2.5.so
00000034f434d000 16 16 8 r---- libc-2.5.so
00000034f4351000 4 4 4 rw--- libc-2.5.so
00000034f4352000 20 20 20 rw--- [ anon ]
00000034f4400000 8 4 0 r-x-- libdl-2.5.so
00000034f4402000 2048 0 0 ----- libdl-2.5.so
00000034f4602000 4 4 4 r---- libdl-2.5.so
00000034f4603000 4 4 4 rw--- libdl-2.5.so
00000034f4800000 108 36 0 r-x-- libpcre.so.0.0.1
00000034f481b000 2048 0 0 ----- libpcre.so.0.0.1
00000034f4a1b000 4 4 4 rw--- libpcre.so.0.0.1
00000034f4c00000 80 52 0 r-x-- libz.so.1.2.3
00000034f4c14000 2044 0 0 ----- libz.so.1.2.3
00000034f4e13000 4 4 4 rw--- libz.so.1.2.3
00000034f5400000 236 0 0 r-x-- libsepol.so.1
00000034f543b000 2048 0 0 ----- libsepol.so.1
00000034f563b000 4 4 4 rw--- libsepol.so.1
00000034f563c000 40 0 0 rw--- [ anon ]
00000034f5800000 84 0 0 r-x-- libselinux.so.1
00000034f5815000 2048 0 0 ----- libselinux.so.1
00000034f5a15000 8 8 8 rw--- libselinux.so.1
00000034f5a17000 4 4 4 rw--- [ anon ]
00000034f6800000 36 4 0 r-x-- libcrypt-2.5.so
00000034f6809000 2044 0 0 ----- libcrypt-2.5.so
00000034f6a08000 4 4 4 r---- libcrypt-2.5.so
00000034f6a09000 4 4 4 rw--- libcrypt-2.5.so
00000034f6a0a000 184 0 0 rw--- [ anon ]
00000034f6c00000 1204 8 0 r-x-- libcrypto.so.0.9.8e
00000034f6d2d000 2044 0 0 ----- libcrypto.so.0.9.8e
00000034f6f2c000 132 84 20 rw--- libcrypto.so.0.9.8e
00000034f6f4d000 16 16 16 rw--- [ anon ]
00000034f7000000 176 0 0 r-x-- libgssapi_krb5.so.2.2
00000034f702c000 2048 0 0 ----- libgssapi_krb5.so.2.2
00000034f722c000 8 8 8 rw--- libgssapi_krb5.so.2.2
00000034f7800000 280 4 0 r-x-- libssl.so.0.9.8e
00000034f7846000 2048 0 0 ----- libssl.so.0.9.8e
00000034f7a46000 24 16 12 rw--- libssl.so.0.9.8e
00000034f9000000 8 0 0 r-x-- libkeyutils-1.2.so
00000034f9002000 2044 0 0 ----- libkeyutils-1.2.so
00000034f9201000 4 4 4 rw--- libkeyutils-1.2.so
00000034f9800000 68 0 0 r-x-- libresolv-2.5.so
00000034f9811000 2048 0 0 ----- libresolv-2.5.so
00000034f9a11000 4 4 4 r---- libresolv-2.5.so
00000034f9a12000 4 4 4 rw--- libresolv-2.5.so
00000034f9a13000 8 0 0 rw--- [ anon ]
00000034fa000000 8 0 0 r-x-- libcom_err.so.2.1
00000034fa002000 2044 0 0 ----- libcom_err.so.2.1
00000034fa201000 4 4 4 rw--- libcom_err.so.2.1
00000034fa800000 144 0 0 r-x-- libk5crypto.so.3.1
00000034fa824000 2044 0 0 ----- libk5crypto.so.3.1
00000034faa23000 8 8 8 rw--- libk5crypto.so.3.1
00000034fac00000 32 0 0 r-x-- libkrb5support.so.0.1
00000034fac08000 2044 0 0 ----- libkrb5support.so.0.1
00000034fae07000 4 4 4 rw--- libkrb5support.so.0.1
00000034fb800000 580 0 0 r-x-- libkrb5.so.3.3
00000034fb891000 2048 0 0 ----- libkrb5.so.3.3
00000034fba91000 16 16 12 rw--- libkrb5.so.3.3
00002b643b45e000 4 4 4 rw--- [ anon ]
00002b643b471000 32 32 32 rw--- [ anon ]
00002b643b479000 40 20 0 r-x-- libnss_files-2.5.so
00002b643b483000 2044 0 0 ----- libnss_files-2.5.so
00002b643b682000 4 4 4 r---- libnss_files-2.5.so
00002b643b683000 4 4 4 rw--- libnss_files-2.5.so
00002b643b684000 4 4 4 rw-s- zero (deleted)
00002b643b685000 19612 19600 19600 rw--- [ anon ]
00007fff7a86a000 84 24 24 rw--- [ stack ]
ffffffffff600000 8192 0 0 ----- [ anon ]
---------------- ------ ------ ------
total kB 70052 21948 20996
其中RSS(Resident set size,常驻内存)是进程实际占用的内存数
Kbytes是程序可以访问的虚拟内存大小。
关于Dirty:
Pages of memory are either Free
(available to allocate), Active (in
use), or Inactive. Inactive pages of
memory are either dirty or clean,
depending on if it has been selected
for removal yet or not. An inactive,
dirty page is no longer in use, but is
not yet available for re-use. The
operating system must scan for dirty
pages, and decide to deallocate them.
After they have been guaranteed sync'd
to disk, an inactive page my be
“clean,” or ready for re-use.