May 042010
Display process' memory usage
Answer:
To display memory usage of a process, you can use the command pmap
E.g. To show the emory usage of mysqld
# sudo pmap -d 1076
Address Kbytes Mode Offset Device Mapping
00007fddabb89000 147444 rw--- 0000000000000000 000:00000 [ anon ]
00007fddb4b86000 48 r-x-- 0000000000000000 0ca:00001 libnss_files-2.10.1.so
00007fddb4b92000 2044 ----- 000000000000c000 0ca:00001 libnss_files-2.10.1.so
00007fddb4d91000 4 r---- 000000000000b000 0ca:00001 libnss_files-2.10.1.so
00007fddb4d92000 4 rw--- 000000000000c000 0ca:00001 libnss_files-2.10.1.so
00007fddb4d93000 40 r-x-- 0000000000000000 0ca:00001 libnss_nis-2.10.1.so
00007fddb4d9d000 2044 ----- 000000000000a000 0ca:00001 libnss_nis-2.10.1.so
00007fddb4f9c000 4 r---- 0000000000009000 0ca:00001 libnss_nis-2.10.1.so
00007fddb4f9d000 4 rw--- 000000000000a000 0ca:00001 libnss_nis-2.10.1.so
00007fddb4f9e000 28 r-x-- 0000000000000000 0ca:00001 libnss_compat-2.10.1.so
00007fddb4fa5000 2048 ----- 0000000000007000 0ca:00001 libnss_compat-2.10.1.so
00007fddb51a5000 4 r---- 0000000000007000 0ca:00001 libnss_compat-2.10.1.so
00007fddb51a6000 4 rw--- 0000000000008000 0ca:00001 libnss_compat-2.10.1.so
00007fddb51a7000 4 ----- 0000000000000000 000:00000 [ anon ]
00007fddb51a8000 10240 rw--- 0000000000000000 000:00000 [ anon ]
00007fddb5ba8000 1432 r-x-- 0000000000000000 0ca:00001 libc-2.10.1.so
00007fddb5d0e000 2044 ----- 0000000000166000 0ca:00001 libc-2.10.1.so
00007fddb5f0d000 16 r---- 0000000000165000 0ca:00001 libc-2.10.1.so
00007fddb5f11000 4 rw--- 0000000000169000 0ca:00001 libc-2.10.1.so
00007fddb5f12000 20 rw--- 0000000000000000 000:00000 [ anon ]
00007fddb5f17000 88 r-x-- 0000000000000000 0ca:00001 libgcc_s.so.1
...