$linuxjunkies
>

pmap(1)

Display the memory map of a process, showing virtual memory layout and memory usage per mapping.

UbuntuDebianFedoraArch

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

FlagWhat it does
-xShow extended format with device and inode information
-dShow offset and device number for each mapping
-qQuiet mode; no per-mapping output, only summary totals
-AShow all address types (default shows only major regions)
-nDon't sort; show mappings in kernel order
-NShow only non-resident pages (requires root or /proc access)
-pShow page numbers and details (requires root)
-SShow 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 1234

Show only the summary totals for process 1234, not individual mappings

pmap -q 1234

Display extended format with device and inode info for the first 20 mappings of process 1234

pmap -x 1234 | head -20

Show heap mapping details for the current shell process ($$)

pmap -d $$ | grep heap

Display memory maps for multiple processes at once

pmap 1234 1235 1236

Show swap space usage per mapping for process 1234 (requires root)

sudo pmap -S 1234

Show all address types and filter to display only labeled regions and totals

pmap -A 1234 | grep -E '\[|total'

Related commands