Sunday, April 27, 2008

Find the memory used by a pprocess using pmap command

By looking into /proc or using ps or top, you must calculate all memory usage yourself i.e. add Shared Memory + mapped file + total virtual memory size of the process + Resident Set Size + non-swapped physical memory used by process.

pmap reports the memory map of a process or processes. To display process mappings:
$ pmap pid

-x can be used to provide info about the memory allocation and mapping types per mapping. The amount of resident, non-shared anonymous, and locked memory.

No comments: