In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the Pmap command on the Linux system. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Pmap under Linux provides memory mapping for processes, and the pmap command is used to display the memory status of one or more processes. It reports the address space and memory status information of the process. Pmap is actually a command on Sun OS, and linux supports only its limited functionality.
Name:
Pmap-report memory map of a process (view the memory image information of the process)
Usage
Pmap [- x |-d] [- Q] pids...
Pmap-V
Option meaning
-x extended Show the extended format. Show extended format
-d device Show the device format. Display device format
-q quiet Do not display some header/footer lines. Do not show header and trailer lines
-V show version Displays version of program. Show version
Extended format and device format fields:
Address: start address of map image start address
Kbytes: size of map in kilobytes image siz
RSS: resident set size in kilobytes resident set size
Dirty: dirty pages (both shared and private) in kilobytes dirty page size
Mode: permissions on map image permissions: r=read, w=write, x=execute, s=shared, p=private (copy on write)
Mapping: file backing the map, or'[anon] 'for allocated memory, or' [stack] 'for the program stack. Image support file, [anon] for allocated memory [stack] for program stack
Offset: offset into the file file offset
Device: device name (major:minor) device name
For example:
View the device format for process 1
[root@C44] # pmap-d 11: init [5] Address Kbytes Mode Offset Device Mapping00934000 88 rkashi-0000000000000008VV 00005 ld-2.3.4.so0094a000 4 Rakashi-00000000001500015008VV 00005 ld-2.3.4.so0094b000 4 rw--- 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 3.4.so00a77000 8 rw--- 000000000012b000 libc-2.3.4.so00a79000-000000000000129000 008 rw--- 000000000012b000 008 libc-2.3.4.so00a7b000 8 rw--- 0000000000a7b000 000000 [anon] 00a85000 52 r-rw--- 0000000000a93000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009000008rw--- 000000000012b000 008VIE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 XMub-000000000000000008Val libselinux.so.100daa000 4 rw--- 000000000000d000 008libselinux.so.108048000 008RQUA Xmura-000000000000000008VV 00005 init0804f000 4 rw--- 00000000007000000000000000000000000000000000000 [anon] b7f5d000 8 rw--- 00000000b7f5d000 000RV 00000 [anon] bffee000 72 rw--- 00000000bffee000 000UR 00000 [stack] ffffe000 4-00000000000000000000 [anon] ] mapped: 1700K writeable/private: 276K shared: 0K [root@C44] #
The value of the last row
Mapped represents the size of the virtual address space mapped by the process, that is, the amount of virtual memory pre-allocated by the process, that is, the vsz out of ps.
Writeable/private indicates the amount of private address space occupied by the process, that is, the amount of memory actually used by the process
Shared represents the amount of memory shared by processes and other processes
View the device format of process 1, do not display header and trailer lines
[root@C44] # pmap-d-Q 11: init [5] 00934000 88 rmuri Xmuri-00000000000000008Renzi ld-2.3.4.so0094a000 4 Rakashi-00000000000150000008ld-2.3.4.so0094b000 4 rw--- 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008Rue libc-2.3.4.so00a77000 8r -00000000000012900000008 libc-2.3.4.so00a79000 8 rw--- 000000000012b000 008V 00005 libc-2.3.4.so00a7b000 8 rw--- 0000000000a7b000 00000000 [anon] 00a85000 52 rw--- 000000000000c000 Xmuri-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 .100daa000 4 rw--- 000000000000d000 008 rw--- 000000000000d000 0000005 libselinux.so.108048000 28 rcopyright Xmuri-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [root@C44 ~] #
View the extended format of process 1
[root@C44] # pmap-x 11: init [5] Address Kbytes RSS Anon Locked Mode Mapping00934000 88-r Murray-ld-2.3.4.so0094a000 4-r Murray-ld-2.3.4.so0094b000 4-- -rw--- ld-2.3.4.so0094e000 1188-r Murray-libc-2.3.4.so00a77000 8-r Murray Murray-libc-2.3.4.so00a79000 8-rw--- libc-2.3.4.so00a7b000 8 -rw--- [anon] 00a85000 52-r Murray Xmuri-libsepol.so.100a92000 4-rw--- libsepol.so.100a93000 32-rw--- [anon] 00d9d000 52-- -libselinux.so.100daa000-libselinux.so.100daa000 4-rw--- libselinux.so.108048000 28-r Murray-init0804f000 4-rw--- init084e1000 132-rw--- [anon] b7f5d000 8 -rw--- [anon] bffee000 72-rw--- [stack] ffffe000 4-[anon]-- total KB 1700-[root@C44 ~] #
Cycle through the last line of the device format of process 3066, with an interval of 2 seconds
[root@C44 ~] # while true; do pmap-d 3066 | tail-1; sleep 2 Donemapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0Kmapped: 5412K writeable/private: 2028K shared: 0K Thank you for reading! This is the end of this article on "how to use Pmap commands in Linux system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.