understanding pmap

Yong Huang yong321 at yahoo.com
Tue Mar 9 19:24:14 UTC 2010


> Linux server 2.6.9-42.0.10.ELsmp #1 SMP Fri Feb 16 17:17:21 EST 2007  i686
> i386 GNU/Linux
...
> Red Hat Enterprise Linux AS release 4 (Nahant Update 4)

That version doesn't have /proc/<pid>/smaps.

> How can I detect the memory leak looking at this?

If a process's virtual memory size keeps increasing and never decreases (or sometimes decreases a little), you can call it a memory leak. When you talk to the developer, you can even find out which segment of the virtual memory is increasing.

> How can I know where is the memory?

What do you mean? The second column of your `pmap -d <pid>' is the memory size and the last column is the file this memory segment maps to, or not mapped to any file if it says anon (anonymous). A competent developer may use info in other columns such as the address to debug and find out which heap in his code the shown anon segment corresponds to.

Yong Huang


      




More information about the redhat-list mailing list