How to Check Memory Usage of Process with Linux pmap Command

The Linux pmap command displays the memory usage map of a process or multiple processes. Pmap reports information about the address space or memory usage map of a process.

Pmap is actually a Sun OS command and Linux supports only very limited number of features. But it is very helpful for finding the complete address space of a process. To check memory usage of process we need PID or unique process ID of running process, we can get PID from /proc or regular commands like top or ps.

Earlier we talked about process memory check using ps and top command, this tutorial I will teach how to use pmap command.

Usage syntax

Lets check the basic syntax of pmap command.

# pmap PID


# pmap [options] PID

In the output, it displays total address, kbytes, mode and mapping.


-x extended Show the extended format.
-d device Show the device format.
-q quiet Do not display some header/footer lines.
-V show version Displays version of program.

1) Memory usage map of single process

To check memory usage of a single process use map command followed by the PID number.

Let's check an pmap example:

# pmap 1013
1013: /usr/sbin/sshd
00110000 1480K r-x-- /usr/lib/
00282000 80K rw--- /usr/lib/
00296000 12K rw--- [ anon ]
00299000 36K r-x-- /lib/
002a2000 4K rw--- /lib/
00739000 4K rw--- /lib/
0073a000 8K rw--- [ anon ]
00825000 120K r-x-- /lib/
00843000 4K r---- /lib/
00844000 4K rw--- /lib/
0090d000 32K r-x-- /lib/
00915000 4K rw--- /lib/
00948000 484K r-x-- /usr/sbin/sshd
009c1000 8K rw--- /usr/sbin/sshd
009c3000 20K rw--- [ anon ]
009e0000 92K r-x-- /lib/
009f7000 4K r---- /lib/

total 8232K

2) Memory usage map of multiple processes

We can check memory map of multiple processes by inserting multiple PIDs. For that add multiple PIDs with adding space.

# pmap 1013 1217 1118

3) Extended memory map about a process

To print extended memory information of a process use -x option. Here Address, Kbyte, Dirty, RSS, mode and mapping contains information as below:

Extended and Device Format Fields

Address: start address of map
Kbytes: size of map in kilobytes
RSS: resident set size in kilobytes
Dirty: dirty pages (both shared and private) in kilobytes
Mode: permissions on map: read, write, execute, shared, private (copy on write)
Mapping: file backing the map, or '[ anon ]' for allocated memory, or '[ stack ]' for the program stack
Offset: offset into the file
Device: device name (major:minor)
# pmap -x 1013
1013: /usr/sbin/sshd
Address Kbytes RSS Dirty Mode Mapping
00110000 1480 92 0 r-x--
00282000 80 80 80 rw---
00296000 12 8 4 rw--- [ anon ]
00299000 36 0 0 r-x--
002a2000 4 4 4 rw---
002a3000 16 0 0 r-x--
002a7000 4 4 4 rw---
002ab000 88 4 0 r-x--
002c1000 4 4 4 r----
002c2000 4 4 4 rw---
002c3000 216 4 0 r-x--
002f9000 4 4 4 rw---
002fa000 808 4 0 r-x--
003c4000 24 24 24 rw---
003ca000 152 4 0 r-x--
003f0000 4 4 4 rw---
003f1000 92 0 0 r-x--
00408000 12 12 12 rw---
0040b000 12 0 0 r-x--
0040e000 4 4 4 rw---

-------- ------- ------- ------- -------
total kB 8232 - - -


In this tutorial we learn how to use pmap command to check memory information single and multiple processes. If you have any questions or feedback, feel free to leave a comment.

Leave a Comment