pmap(1)
Display the memory map of a process, showing virtual memory layout and memory usage per mapping.
Synopsis
pmap [OPTION]... PID [PID]...Description
pmap reports the memory map of one or more processes, showing each virtual memory region, the memory permissions, and the resident set size (RSS) for each mapping. This is useful for understanding how a process allocates memory and identifying memory leaks or unexpected memory usage patterns.
The output shows address ranges, sizes, permissions (read, write, execute, shared), and resident memory for each mapped region including heap, stack, libraries, and memory-mapped files. By default, it sums up all mappings at the end.
Common options
| Flag | What it does |
|---|---|
-x | Show extended format with device and inode information |
-d | Show offset and device number for each mapping |
-q | Quiet mode; no per-mapping output, only summary totals |
-A | Show all address types (default shows only major regions) |
-n | Don't sort; show mappings in kernel order |
-N | Show only non-resident pages (requires root or /proc access) |
-p | Show page numbers and details (requires root) |
-S | Show swap space used by each mapping (requires root) |
Examples
Show the complete memory map of process 1234, listing all virtual memory regions and total memory usage
pmap 1234Show only the summary totals for process 1234, not individual mappings
pmap -q 1234Display extended format with device and inode info for the first 20 mappings of process 1234
pmap -x 1234 | head -20Show heap mapping details for the current shell process ($$)
pmap -d $$ | grep heapDisplay memory maps for multiple processes at once
pmap 1234 1235 1236Show swap space usage per mapping for process 1234 (requires root)
sudo pmap -S 1234Show all address types and filter to display only labeled regions and totals
pmap -A 1234 | grep -E '\[|total'