Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation of pmap command for Linux performance test

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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. Display extended format-d device Show the device format. Display device format-q quiet Do not display some header/footer lines. Do not display 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 starting address Kbytes: size of map in kilobytes image size 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] offset Device: device name (major:minor) device name for program stack Offset: offset into the file file

For example:

View the device format for process 1

[root@C44] # pmap-d 11: init [5] Address Kbytes Mode Offset Device Mapping00934000 88 rMurashi-0000000000000008VV 00005 ld-2.3.4.so0094a000 4 rkashi-000000000000015000008VOV 00005 ld-2.3.4.so0094b000 4 rw--- 00000000000000016000000005 ld-2.3.4.so0094e000 1188 Rafaz libc-2.3.4.so00a77000-0000000000000000008Rafe libc-2.3.4.so00a77000 8 rUV-000000000012900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -2.3.4.so00a79000 8 rw--- 000000000012b000 008 libc-2.3.4.so00a7b000 8 rw--- 0000000000a7b000 000 libc-2.3.4.so00a7b000 00000 [anon] 00a85000 52 rw--- 000000000000d000 Xmuri-000000000000000000000000005libsepol.so.100a92000 4 rw--- 000000000000c000 008libc-2.3.4.so00a7b000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 28 Rmurxlux init0804f000-000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007000000000000000000000000070000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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 rMube Xmuri-0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 4.so00a79000 8 rw--- 000000000012b000 008 libc-2.3.4.so00a7b000 8 rw--- 0000000000a7b000 000lv 00000 [anon] 00a85000 52 rlyx 00d9d000-00000000000000000000000000000000000000000000000 libsepol.so.100a92000 4 rw--- 000000000000c000 008Vl0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800d9d000- -000000000000000008init0804f000 4 rw--- 00000000000007000000000005132 rw--- 00000000084e1000 000000 b7f5d000 000000 [anon] b7f5d000 8 rw--- 00000000b7f5d000 00000000 [anon] bffee000 72 rw--- 00000000bffee000 00000000 [stack] ffffe000 4-0000000000000000000000 [anon] [root@C44 ~] #

View the extended format of process 1

[root@C44] # pmap-x 11: init [5] Address Kbytes RSS Anon Locked Mode Mapping00934000 88-rMurray-ld-2.3.4.so0094a000 4-Rakashi-ld-2.3.4.so0094b000 4-rw--- ld-2.3.4.so0094e000 1188-Rafael Xmuri-libc -2.3.4.so00a77000 8-r murmuri-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-r Murray Xmuri-libselinux.so.100daa000 4-rw--- libselinux.so.108048000 28-r Murray Xmuri-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

Summary

The above is the detailed explanation of the Linux performance test pmap command introduced by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply to you in time. Thank you very much for your support to the website!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report