pmap command

displays the mapped memory of a process, including libaries

Typical usage: memory leakage detection, process monitoring, troubleshooting

Introduction 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 systemPackage nameInstallation
AlmaLinuxprocps-ng
dnf install procps-ng
Arch Linuxprocps-ng
pacman -S procps-ng
Debianprocps
apt install procps
Fedoraprocps-ng
dnf install procps-ng
Red Hat Enterprise Linuxprocps-ng
dnf install procps-ng
Rocky Linuxprocps-ng
dnf install procps-ng
openSUSEprocps
zypper install procps
Ubuntuprocps
apt install procps

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

Long optionShort optionDescription
--extended-xIncrease number of columns to show, including memory sizes
--show-path-pInclude full paths in output
-XMore extensive output than -x, which relies on data from /proc/PID/smaps
-XXShow 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:

Related and similar commands to pmap
CommandCategorySummary
basenamefilesStrips directory and file name suffix from a given path
chrtprocessesSets Linux scheduler policy and priority for a process or command
dmidecodehardwareShows hardware information
killprocessesSending signals to processes
niceprocessesRuns commands with specified priority
numactlprocessesControls NUMA policy for processes and shared memory
peekfdprocessesTracks a process and show file descriptor activity
pidofprocessesReturns process IDs for a process name
pidstatmonitoringMonitoring CPU, memory, and disk activity
pidwaitprocessesWait for process to stop
prtstatprocessesShows process details for selected process like state, CPU and memory usage
pscapcapabilitiesDisplay available capabilities for running processes
pslogloggingShows which log files a process has opened
pstreeprocessesShow active processes and children like a tree
pwdxprocessesShows current working directory of a process
reniceprocessesChanges the priority of running processes
slabtopmemoryShows slab usage of kernel
smemmemoryShow memory usage including swap
straceprocess inspectionInspects running process
unitsdata conversionConverts a unit into another one, like from Celcius to Fahrenheit
vmstatmemoryShows virtual memory information, disk IO, CPU activity
watchprocessesMonitors changes in output of specified command