pmap command
displays the mapped memory of a process, including libaries
Typical usage: memory leakage detection, process monitoring, troubleshootingIntroduction into pmap
The pmap tool retrieves the process mapping of a running process and displays this on screen with a defined level of formatting. When running the command without any specific options, it only requires the process ID (PID). To receive full output and see all details, most likely -XX provides the most level of detail.
Fields that pmap can show include:
- Address
- Perm
- Offset
- Device
- Inode
- Size
- KernelPageSize*
- MMUPageSize
- Rss
- Pss
- Pss_Dirty
- Shared_Clean
- Shared_Dirty
- Private_Clean
- Private_Dirty
- Referenced
- Anonymous
- LazyFree
- AnonHugePages
- ShmemPmdMapped
- FilePmdMapped
- Shared_Hugetlb
- Private_Hugetlb
- Swap
- SwapPss
- Locked
- THPeligible
- ProtectionKey
- VmFlags
- Mapping
Installation
When pmap is not installed by default, it can be added to the system using the relevant software package.
Package information for pmap
Operating system | Package name | Installation |
---|---|---|
AlmaLinux | procps-ng |
|
Arch Linux | procps-ng |
|
Debian | procps |
|
Fedora | procps-ng |
|
Red Hat Enterprise Linux | procps-ng |
|
Rocky Linux | procps-ng |
|
openSUSE | procps |
|
Ubuntu | procps |
|
Your Linux distribution using a different package? Share your feedback.
Usage
Available options
Long option | Short option | Description |
---|---|---|
--extended | -x | Increase number of columns to show, including memory sizes |
--show-path | -p | Include full paths in output |
-X | More extensive output than -x, which relies on data from /proc/PID/smaps | |
-XX | Show all available columns with data that the Linux kernel can provide about this process |
Missing an option in this overview? Share your feedback.
Frequently Asked Questions
What is the pmap command and its purpose?
The pmap command is a command-line tool to show the memory mappings of a process
Which package provides the pmap command?
The command pmap is provided by the procps or procps-ng package.
Related and similar commands
Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to pmap:
Command | Category | Summary |
---|---|---|
basename | files | Strips directory and file name suffix from a given path |
chrt | processes | Sets Linux scheduler policy and priority for a process or command |
dmidecode | hardware | Shows hardware information |
kill | processes | Sending signals to processes |
nice | processes | Runs commands with specified priority |
numactl | processes | Controls NUMA policy for processes and shared memory |
peekfd | processes | Tracks a process and show file descriptor activity |
pidof | processes | Returns process IDs for a process name |
pidstat | monitoring | Monitoring CPU, memory, and disk activity |
pidwait | processes | Wait for process to stop |
prtstat | processes | Shows process details for selected process like state, CPU and memory usage |
pscap | capabilities | Display available capabilities for running processes |
pslog | logging | Shows which log files a process has opened |
pstree | processes | Show active processes and children like a tree |
pwdx | processes | Shows current working directory of a process |
renice | processes | Changes the priority of running processes |
slabtop | memory | Shows slab usage of kernel |
smem | memory | Show memory usage including swap |
strace | process inspection | Inspects running process |
units | data conversion | Converts a unit into another one, like from Celcius to Fahrenheit |
vmstat | memory | Shows virtual memory information, disk IO, CPU activity |
watch | processes | Monitors changes in output of specified command |