Chapter 2. Monitoring and benchmark tools 53
Draft Document for Review May 4, 2007 11:35 am 4285ch02.fm
whether this amount of memory is a cause of memory bottlenecks. For detailed information,
use pmap -d option.
pmap -d <pid>
Example 2-20 Process memory information the init process is using
[root@lnxsu4 ~]# pmap -d 1
1: init [3]
Address Kbytes Mode Offset Device Mapping
0000000000400000 36 r-x-- 0000000000000000 0fd:00000 init
0000000000508000 8 rw--- 0000000000008000 0fd:00000 init
000000000050a000 132 rwx-- 000000000050a000 000:00000 [ anon ]
0000002a95556000 4 rw--- 0000002a95556000 000:00000 [ anon ]
0000002a95574000 8 rw--- 0000002a95574000 000:00000 [ anon ]
00000030c3000000 84 r-x-- 0000000000000000 0fd:00000 ld-2.3.4.so
00000030c3114000 8 rw--- 0000000000014000 0fd:00000 ld-2.3.4.so
00000030c3200000 1196 r-x-- 0000000000000000 0fd:00000 libc-2.3.4.so
00000030c332b000 1024 ----- 000000000012b000 0fd:00000 libc-2.3.4.so
00000030c342b000 8 r---- 000000000012b000 0fd:00000 libc-2.3.4.so
00000030c342d000 12 rw--- 000000000012d000 0fd:00000 libc-2.3.4.so
00000030c3430000 16 rw--- 00000030c3430000 000:00000 [ anon ]
00000030c3700000 56 r-x-- 0000000000000000 0fd:00000 libsepol.so.1
00000030c370e000 1020 ----- 000000000000e000 0fd:00000 libsepol.so.1
00000030c380d000 4 rw--- 000000000000d000 0fd:00000 libsepol.so.1
00000030c380e000 32 rw--- 00000030c380e000 000:00000 [ anon ]
00000030c4500000 56 r-x-- 0000000000000000 0fd:00000 libselinux.so.1
00000030c450e000 1024 ----- 000000000000e000 0fd:00000 libselinux.so.1
00000030c460e000 4 rw--- 000000000000e000 0fd:00000 libselinux.so.1
00000030c460f000 4 rw--- 00000030c460f000 000:00000 [ anon ]
0000007fbfffc000 16 rw--- 0000007fbfffc000 000:00000 [ stack ]
ffffffffff600000 8192 ----- 0000000000000000 000:00000 [ anon ]
mapped: 12944K writeable/private: 248K shared: 0K
Some of the most important information is at the bottom of the display. The line shows:
mapped: total amount of memor y mapped to files used in the process
writable/private: the amount of private address space this process is taking.
shared: the amount of address space this process is sharing with others.
You can also take a look at the address spaces where the information is stored. You can find
an interesting difference when you issue the pmap command on 32-bit and 64-bit systems. For
the complete syntax of the pmap command, issue:
pmap -?
2.3.11 netstat
netstat is one of the most popular tools. If you work on the network. you should be familiar
with this tool. It displays a lot of network related information such as socket usage, routing,
interface, protocol, network statistics etc. Here are some of the basic options:
-a Show all socket information
-r Show routing information
-i Show network interface statistics
-s Show network protocol statistics