pmap command in Linux with Examples
Last Updated :
01 Oct, 2024
The pmap command in Linux is a powerful utility used to display the memory map of a process. A memory map provides insight into how memory is allocated and distributed within a running process. This can be incredibly useful for developers and system administrators when debugging memory issues, optimizing performance, or gaining an in-depth understanding of memory usage in Linux.
Syntax
pmap [options] pid [...]
where,
- pid: This represents the Process ID of the process whose memory map you want to display. You can find the pid of a process using commands like ps, top, or pgrep.
Basic Example

Key Options for the pmap Command
1. -x: Extended Format
This option displays the memory map in an extended format, which provides additional details such as the resident memory size (RSS), shared memory size, private memory size, and more.
Example:
pmap -x 9466

2. -p: Show Full Path
This option displays the full path to the files mapped in memory. It is helpful to know which files are being used by the process.
Example:
pmap -p 9466

3. -d: Device Format
This option displays memory in a device format, showing information like the device number and inode for mapped files.
Example:
pmap -d 9466

4. -q: Quiet Mode (No Column Names)
When using this option, pmap will display the memory map without the column names, making the output more compact. This is useful for scripts where column headers may not be necessary.
Example:
pmap -q -d 9466

5. -A: Display Memory Map for a Specific Range
This option is used to display results to the given range. Notice that the low and high arguments are single string separated with a comma.
Example:
pmap -A 000055a5908f8000, 00007fd264ed2000 11747
6. -XX: Display All Information Provided by the Kernel
The -XX option provides a complete and exhaustive output of the memory map, showing everything the kernel provides, including more detailed memory attributes like permissions and offsets.
Example:
pmap -xx [PID]
7. -n: Create a New Configuration
This option is used to create a new configuration.
Example:
pmap -n
8. -c: Read Default Configuration
If you want to revert to the default configuration or read an existing configuration, the -c option can be used. This is particularly useful when troubleshooting configuration issues.
Example:
pmap -c [PID]
9. -h: Display Help Text
To display a help message with all available options and usage information, use the -h option.
pmap -h
10. -v: Display Version Information
If you want to check the version of pmap that is installed on your system, use the -v option.
pmap -v
Conclusion
The pmap command is a versatile and essential tool for anyone needing to analyze process memory usage in Linux. pmap offers a range of options to display and investigate a process’s memory map in detail. By leveraging options like -x for extended format, -p for full file paths, and -XX for exhaustive kernel information, users can gain a comprehensive understanding of how memory is allocated and used in their system.
Similar Reads
How to Move File in Linux | mv Command
The `mv` command in Linux is like a superhero tool that can do a bunch of cool stuff with your files and folders. Think of it as a digital moving truck that helps you shift things around in your computer. Whether you want to tidy up your folders, give your files new names, or send them to different
7 min read
Practical Uses of nc(netcat) command in Linux
Netcat is one of the most powerful networking tools, security tools, and network monitoring tools. It is even considered a Swiss army knife of networking tools. It acts like a cat command over a network. It is generally used for the following reasons: Operation related to TCP, UDP, or UNIX-domain so
8 min read
Netstat command in Linux
The netstat command is like a special tool in Linux that helps you understand and check things about how your computer connects to the internet. It can tell you about the connections your computer is making, the paths it uses to send information, and even some technical details like how many packets
7 min read
Manage Network Connections From the Linux Command Line with nmcli
Network connectivity is a critical aspect of modern computing, and Linux provides a robust command-line tool for managing network connections: nmcli. Network Manager Command-Line Interface (nmcli) is a powerful and versatile utility that allows users to control and configure network settings directl
5 min read
Nslookup Command in Linux with Examples
Nslookup (stands for âName Server Lookupâ) is a useful command for getting information from the DNS server. It is a network administration tool for querying the Domain Name System (DNS) to obtain domain name or IP address mapping or any other specific DNS record. It is also used to troubleshoot DNS-
6 min read
od command in Linux with example
The od (octal dump) command in Linux is a versatile tool used to display file contents in various formats, with the default being octal. This command is particularly useful for debugging scripts, examining binary files, or visualizing non-human-readable data like executable code. It allows users to
6 min read
How to Change User Password in Linux | passwd Command
Securing user accounts is a fundamental aspect of maintaining a robust and secure Linux system. One essential task is changing user passwords regularly to prevent unauthorized access. The passwd command in Linux provides a straightforward and effective way to modify user passwords. This article will
8 min read
Paste command in Linux with examples
Paste command is one of the useful commands in Unix or Linux operating system. It is used to join files horizontally (parallel merging) by outputting lines consisting of lines from each file specified, separated by tab as delimiter, to the standard output. When no file is specified, or put dash ("-"
6 min read
pidof Command in Linux with Examples
pidof command is used to find out the process IDs of a specific running program. It is basically an identification number that is automatically assigned to each process when it is created. Syntax: pidof [options] program1 program2 ... programNWorking with Pidof Command 1. To find pid of any process
2 min read
How to Check Network Connectivity in Linux | ping Command
Ensuring a stable and reliable internet connection is crucial for seamless navigation and efficient communication in the world of Linux. The "ping" command is a powerful tool that allows users to check the status of their internet connection and diagnose network-related issues. In this article, we w
7 min read