lost and found ( for me ? )

small tips : pmap - report memory map of a process

small tips.

pmap is a tool to check memory usage , check memory mapping of processes.
Of course , we can do the same thing by checking under /proc/PID directory , but we can analyze memory mapping easily by using pmap.

In case of Fedroa 17 , pmap has been installed by default , so I don’t need to install pmap via yum.

[root@f17-64 ~]# cat /etc/fedora-release
Fedora release 17 (Beefy Miracle)

[root@f17-64 ~]# pmap -V
pmap (procps version 3.2.8)


[ usage ]

pmap PID
pmap -x PID

-x : extended       Show the extended format

[ sample outputs ]

memory mapping of unbound process
[root@f17-64 ~]# pmap -x `pgrep unbound`
1125:   /usr/sbin/unbound
Address           Kbytes     RSS   Dirty Mode   Mapping
0000000000400000     700     452       0 r-x--  unbound
00000000006ae000       4       4       4 r----  unbound
00000000006af000      20       8       8 rw---  unbound
00000000006b4000       4       4       4 rw---    [ anon ]
0000000001f0a000     400     380     380 rw---    [ anon ]
0000000001f6e000    9724    9460    9460 rw---    [ anon ]
0000003652e00000     128      28       0 r-x--  ld-2.15.so
000000365301f000       4       4       4 r----  ld-2.15.so
0000003653020000       4       4       4 rw---  ld-2.15.so
0000003653021000       4       4       4 rw---    [ anon ]
0000003653200000    1712     472       0 r-x--  libc-2.15.so
00000036533ac000    2048       0       0 -----  libc-2.15.so
00000036535ac000      16      16       8 r----  libc-2.15.so
00000036535b0000       8       8       8 rw---  libc-2.15.so
00000036535b2000      20      20      20 rw---    [ anon ]
0000003653600000      88      60       0 r-x--  libpthread-2.15.so
0000003653616000    2048       0       0 -----  libpthread-2.15.so
0000003653816000       4       4       4 r----  libpthread-2.15.so
0000003653817000       4       4       4 rw---  libpthread-2.15.so
0000003653818000      16       4       4 rw---    [ anon ]
0000003653a00000      12       4       0 r-x--  libdl-2.15.so
0000003653a03000    2044       0       0 -----  libdl-2.15.so
0000003653c02000       4       4       4 r----  libdl-2.15.so
0000003653c03000       4       4       4 rw---  libdl-2.15.so
0000003653e00000    1000       0       0 r-x--  libm-2.15.so
0000003653efa000    2044       0       0 -----  libm-2.15.so
00000036540f9000       4       4       4 r----  libm-2.15.so
00000036540fa000       4       4       4 rw---  libm-2.15.so
0000003654200000      92      56       0 r-x--  libz.so.1.2.5
0000003654217000    2044       0       0 -----  libz.so.1.2.5
0000003654416000       4       4       4 rw---  libz.so.1.2.5
0000003654600000      28      12       0 r-x--  librt-2.15.so
0000003654607000    2044       0       0 -----  librt-2.15.so
0000003654806000       4       4       4 r----  librt-2.15.so
0000003654807000       4       4       4 rw---  librt-2.15.so
0000003654a00000     120       0       0 r-x--  libselinux.so.1
0000003654a1e000    2044       0       0 -----  libselinux.so.1
0000003654c1d000       4       4       4 r----  libselinux.so.1
0000003654c1e000       4       4       4 rw---  libselinux.so.1
0000003654c1f000       8       4       4 rw---    [ anon ]
0000003654e00000      88       0       0 r-x--  libresolv-2.15.so
0000003654e16000    2044       0       0 -----  libresolv-2.15.so
0000003655015000       4       4       4 r----  libresolv-2.15.so
0000003655016000       4       4       4 rw---  libresolv-2.15.so
0000003655017000       8       0       0 rw---    [ anon ]
0000003655200000     320     172       0 r-x--  libldns.so.1.6.16
0000003655250000    2044       0       0 -----  libldns.so.1.6.16
000000365544f000       4       4       4 r----  libldns.so.1.6.16
0000003655450000      24      24      16 rw---  libldns.so.1.6.16
0000003655600000    1456      12       0 r-x--  libpython2.7.so.1.0
000000365576c000    2048       0       0 -----  libpython2.7.so.1.0
000000365596c000       4       4       4 r----  libpython2.7.so.1.0
000000365596d000     244     136     136 rw---  libpython2.7.so.1.0
00000036559aa000      64       0       0 rw---    [ anon ]
0000003656a00000      84       0       0 r-x--  libgcc_s-4.7.2-20120921.so.1
0000003656a15000    2044       0       0 -----  libgcc_s-4.7.2-20120921.so.1
0000003656c14000       4       4       4 rw---  libgcc_s-4.7.2-20120921.so.1
0000003657e00000     272     112       0 r-x--  libevent-2.0.so.5.1.6
0000003657e44000    2048       0       0 -----  libevent-2.0.so.5.1.6
0000003658044000       4       4       4 r----  libevent-2.0.so.5.1.6
0000003658045000       4       4       4 rw---  libevent-2.0.so.5.1.6
0000003658046000       4       0       0 rw---    [ anon ]
000000365e600000    1488     660       0 r-x--  libcrypto.so.1.0.0j
000000365e774000    2048       0       0 -----  libcrypto.so.1.0.0j
000000365e974000     136     120      20 rw---  libcrypto.so.1.0.0j
000000365e996000      16      12      12 rw---    [ anon ]
0000003660200000      12       4       0 r-x--  libcom_err.so.2.1
0000003660203000    2044       0       0 -----  libcom_err.so.2.1
0000003660402000       4       4       4 r----  libcom_err.so.2.1
0000003660403000       4       4       4 rw---  libcom_err.so.2.1
0000003662200000      12       0       0 r-x--  libkeyutils.so.1.4
0000003662203000    2044       0       0 -----  libkeyutils.so.1.4
0000003662402000       4       4       4 rw---  libkeyutils.so.1.4
0000003662a00000     160       4       0 r-x--  libk5crypto.so.3.1
0000003662a28000    2048       0       0 -----  libk5crypto.so.3.1
0000003662c28000       4       4       4 r----  libk5crypto.so.3.1
0000003662c29000       4       4       4 rw---  libk5crypto.so.3.1
0000003662c2a000       4       0       0 rw---    [ anon ]
0000003662e00000     868       4       0 r-x--  libkrb5.so.3.3
0000003662ed9000    2048       0       0 -----  libkrb5.so.3.3
00000036630d9000      40       8       4 r----  libkrb5.so.3.3
00000036630e3000       8       8       8 rw---  libkrb5.so.3.3
0000003663200000     260       4       0 r-x--  libgssapi_krb5.so.2.2
0000003663241000    2048       0       0 -----  libgssapi_krb5.so.2.2
0000003663441000       4       4       4 r----  libgssapi_krb5.so.2.2
0000003663442000       8       8       8 rw---  libgssapi_krb5.so.2.2
0000003663600000      40       0       0 r-x--  libkrb5support.so.0.1
000000366360a000    2044       0       0 -----  libkrb5support.so.0.1
0000003663809000       4       4       4 r----  libkrb5support.so.0.1
000000366380a000       4       4       4 rw---  libkrb5support.so.0.1
0000003666200000     336     176       0 r-x--  libssl.so.1.0.0j
0000003666254000    2044       0       0 -----  libssl.so.1.0.0j
0000003666453000      32      32      16 rw---  libssl.so.1.0.0j
0000003667200000       8       0       0 r-x--  libutil-2.15.so
0000003667202000    2044       0       0 -----  libutil-2.15.so
0000003667401000       4       4       4 r----  libutil-2.15.so
0000003667402000       4       4       4 rw---  libutil-2.15.so
00007f924600f000     236     236     236 rw---    [ anon ]
00007f924608b000      48      16       0 r-x--  libnss_files-2.15.so
00007f9246097000    2044       0       0 -----  libnss_files-2.15.so
00007f9246296000       4       4       4 r----  libnss_files-2.15.so
00007f9246297000       4       4       4 rw---  libnss_files-2.15.so
00007f9246298000     304     304     304 rw---    [ anon ]
00007f92462fc000       4       4       4 rw---    [ anon ]
00007fffda00e000     132      32      32 rw---    [ stack ]
00007fffda03f000       4       4       0 r-x--    [ anon ]
ffffffffff600000       4       0       0 r-x--    [ anon ]
----------------  ------  ------  ------
total kB           65956   13216   10828


memory mapping of httpd processes
[root@f17-64 ~]# pmap -x `pgrep httpd` | head -10
4475:   /usr/sbin/httpd -k start
Address           Kbytes     RSS   Dirty Mode   Mapping
00007fe85af11000       8       8       0 r-x--  apr_ldap-1.so
00007fe85af13000    2044       0       0 -----  apr_ldap-1.so
00007fe85b112000       4       4       4 r----  apr_ldap-1.so
00007fe85b113000       4       4       4 rw---  apr_ldap-1.so
00007fe85b114000      12       8       0 r-x--  libnss_myhostname.so.2
00007fe85b117000    2044       0       0 -----  libnss_myhostname.so.2
00007fe85b316000       4       4       4 r----  libnss_myhostname.so.2
00007fe85b317000       4       4       4 rw---  libnss_myhostname.so.2

[root@f17-64 ~]# pmap `pgrep httpd` | egrep ":|total"
4475:   /usr/sbin/httpd -k start
total           183136K
4476:   /usr/sbin/httpd -k start
total           183136K
4477:   /usr/sbin/httpd -k start
total           183136K
4478:   /usr/sbin/httpd -k start
total           183136K
4479:   /usr/sbin/httpd -k start
total           183136K
4480:   /usr/sbin/httpd -k start
total           183136K
4481:   /usr/sbin/httpd -k start
total           183136K
4482:   /usr/sbin/httpd -k start
total           183136K
4483:   /usr/sbin/httpd -k start
total           183136K
5253:   /usr/sbin/httpd -k start
total           183136K
5254:   /usr/sbin/httpd -k start
total           183136K
5255:   /usr/sbin/httpd -k start
total           183136K
5256:   /usr/sbin/httpd -k start
total           183136K
5257:   /usr/sbin/httpd -k start
total           183136K
5258:   /usr/sbin/httpd -k start
total           183136K
5259:   /usr/sbin/httpd -k start
total           183136K
5260:   /usr/sbin/httpd -k start
total           183136K
5261:   /usr/sbin/httpd -k start
total           183136K
5262:   /usr/sbin/httpd -k start
total           183136K
5263:   /usr/sbin/httpd -k start
total           183136K
5264:   /usr/sbin/httpd -k start
total           183136K
5265:   /usr/sbin/httpd -k start
total           183136K
5266:   /usr/sbin/httpd -k start
total           183136K
5267:   /usr/sbin/httpd -k start
total           183136K
5271:   /usr/sbin/httpd -k start
total           183136K
5272:   /usr/sbin/httpd -k start
total           183136K
5273:   /usr/sbin/httpd -k start
total           183136K
5274:   /usr/sbin/httpd -k start
total           183136K
5275:   /usr/sbin/httpd -k start
total           183136K
5276:   /usr/sbin/httpd -k start
total           183136K


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.