pmap - 显示进程的地址空间的相关信息
/usr/bin/pmap [-bhrslF] [-A address_range] [--scale[=item1,item2,...]] [pid | core]...
/usr/bin/pmap -L [-bhrslF] [-A address_range] [--scale[=item1,item2,...]] [pid] ...
/usr/bin/pmap -x [-ahslF] [-A address_range] [--scale[=item1,item2,...]] [pid]...
/usr/bin/pmap -S [-ahlF] [-A address_range] [--scale[=item1,item2,...]] [pid | core]...
pmap 实用程序列显进程的地址空间的相关信息。
支持以下选项:
列显用于共享映射的匿名和交换预留空间。
指定要显示的地址空间子范围。address_range 是以下列格式之一指定的:
单个地址,将输出限制为包含该地址的段(或页面,如果提供了 –L 选项)。如果指定的地址对应于某个段的起始地址,则输出将始终包括整个段,即使指定了 –L 选项。
后跟逗号但没有结束地址的地址,将输出限制为从包含指定地址的段开始的所有段(或页面,如果提供了 –L 选项)。
由起始地址和结束地址指定的地址范围,将输出限制为从包含起始地址的段或页面到包含结束地址的段或页面之间的所有段(或页面,如果提供了 –L 选项)。
前接逗号但没有起始地址的地址范围,将输出限制为从第一个段(或页面,如果提供了 –L 选项)到包含指定地址的段(或页面,如果提供了 –L 选项)之间的所有段或页面。
输出映射的文件的基名,而不是完整文件路径(请参见 basename(1))。
强制。抓取目标进程,即使另一进程已掌握了控制权。
有关更多信息,请参见“用法”部分。
On output, memory sizes are scaled to a human readable format.The –h option is equivalent to using the –scale=max,1024 option.
显示未解析的动态链接程序映射名称。
输出包含为虚拟内存提供后备支持的物理内存的 lgroup。
列显进程的保留地址。
列显 HAT 页面大小信息。
显示每个映射的交换预留空间信息。有关更多信息,请参见“用法”部分。
显示每个映射的其他信息。有关更多信息,请参见“用法”部分。
On output, memory sizes are scaled to a human readable format, for example, 14K, 234M, 2.7G, or 3.0T.Scaling is done by repetitively dividing by 1024, unless otherwise specified.
–scale specified without arguments enables default scaled output, and is equivalent to –scale=max,1024.
–scale can be specified with the following arguments.
Scaling is done by repetitively dividing by a scale factor of 1024.The use of binary scaling is indicated by the addition of an 'i' modifier to the suffix (Ki, Mi, Gi, ...).
Values are scaled to the largest unit for which the result retains a non-zero integer part.Up to 2 decimal places of fractional output may be shown.
Values are scaled to the smallest unit capable of showing the full value within the allotted space of 5 columns, and displayed without the use of fractional output.
Values are scaled to the smallest unit capable of showing the full value within the allotted space of 8 columns, and displayed without the use of fractional output.
Scaling is done by repetitively dividing by a scale factor of 1000.
Scaling is done by repetitively dividing by a scale factor of 1024.
输出用法消息并立即退出。
pmap 实用程序列显进程的地址空间的相关信息。
/usr/bin/pmap [ -rslF ] [-A address_range] [ pid | core ] ...
缺省情况下,pmap 按映射被映射到进程的虚拟地址顺序显示所有映射。将显示映射大小、标志和被映射对象的名称。
可以使用 –A 选项将输出限制到指定的地址范围。指定的地址向上或向下舍入到段边界,输出包括由这些地址界定的段。
/usr/bin/pmap -L [ -rslF ] [-A address_range] pid ...
可使用 –L 选项来确定包含为指定虚拟内存提供后备支持的物理内存的 lgroup。与 –A 选项一起使用时,指定的地址向上或向下舍入到页面边界,输出被限制到由这些地址界定的页面。
这可以与 plgrp(1) 结合使用来查明所关注的线程的主 lgroup 是否与内存所在位置一样,以及该位置是否应当为该线程的内存地址。lgrpinfo(1) 命令与该 pmap 选项结合使用时也很有用。It displays the lgroup hierarchy, contents, and characteristics which gives more information about the lgroups that the memory is distributed across and their relationship to each other and any other lgroups of interest.
此外,可以通过使用 plgrp(1), pmadvise(1) 或 madv.so.1(1) 更改线程和内存的布置。
/usr/bin/pmap -x [ -aslF ] [-A address_range] [ pid] ...
–x 选项显示每个映射的其他信息。使用此选项可显示每个映射的大小、驻留物理内存 (resident physical memory, RSS) 量、匿名内存量以及锁定的内存量。此选项不包括内核地址空间因该进程而占用的匿名内存。
/usr/bin/pmap -S [ -alF ] [-A address_range] [ pid | core ] ...
–S 选项显示每个映射的交换预留空间信息。
使用 –F 标志时应谨慎。在一个被调试的进程上施加两个控制进程可能会导致混乱。仅当主控制进程(通常是调试器)停止了被调试的进程,并且在应用相关 proc 工具的时刻主控制进程未在执行任何操作,才能保证安全。
除非指定了 –s 或 –L 选项,否则将为进程内的每个映射列显一行输出。使用 –s 选项时,将为每个硬件转换页面大小的连续映射列显一行。使用 –L 选项时,对于属于同一 lgroup 的连续映射,将输出一行。同时使用 –L 和 –s 选项时,对于属于同一 lgroup 的每个硬件转换页面大小的连续映射,将输出一行。下面的括号中显示的是列标题。
输出的第一列表示每个映射的起始虚拟地址。虚拟地址是以升序显示的。
每个映射的虚拟大小(以千字节为单位)。See –scale.
为每个映射驻留的物理内存量(以千字节为单位),包括与其他地址空间共享的物理内存。See –scale.
使用系统页面大小计数的与指定映射相关联的匿名内存的页面数。不包括与其他地址空间共享的匿名内存,除非指定了 –a 选项。
为包含通过 MAP_PRIVATE.映射的映射的“写入时复制”页面的进程堆、栈报告匿名内存。有关更多信息,请参见 mmap(2) 手册页。
映射内被锁定的页面数。典型示例有通过 mlock() 锁定的内存和通过 SHM_SHARE_MMU 创建的 System V 共享内存。
显示每个映射的虚拟内存权限。有效权限有:
进程可以读取映射。
进程可以写入映射。
进程可以执行驻留在映射内的指令。
可以显示为每个映射显示其他信息的标志:
映射是共享的,因此在所观察的地址空间中所做的更改将提交到映射的文件,且可以从共享该映射的所有其他进程中看到这些更改。
针对 ADI 启用了映射。
没有为此映射预留交换空间。使用 MAP_NORESERVE 创建的映射和 System V ISM 共享内存映射不预留交换空间。
映射包含活动的删改请求,并将包含在核心文件内或从中排除。“I”指示包含,而“E”指示排除。
核心文件中不存在映射数据(仅当应用于核心文件时适用)。有关配置核心文件内容的信息,请参见 coreadm(8) 手册页。
包含为指定映射提供后备支持的物理内存的 lgroup。
每个映射的说明性名称。将为映射显示下列主要的名称类型:
For mappings between a process and a file, the pmap command attempts to resolve the segment name, and file name for each mapping.如果无法解析文件名,pmap 将显示包含该文件的主设备号和从设备号,以及文件的文件系统 inode 编号。
Memory not relating to any named object or file within the file system is reported as [ anon ].
pmap 命令显示某些已知匿名内存映射的通用名称:
映射是进程堆。
映射是主栈。
映射是线程 n 的栈。
映射用作线程 n 的备用信号栈。
如果映射的通用名称未知,pmap 将 [ anon ] 显示为映射名称。
Mappings created using System V shared memory system calls are reported with the names shown below:
映射是 System V 共享内存映射。报告了创建映射时使用的共享内存标识符。
映射是 System V 共享内存的“锁定共享内存”(ISM) 变体。ISM mappings are created with the SHM_SHARE_MMU flag set, in accordance with shmat(2).
映射是 ISM 的可分页变体。Pageable ISM is created with the SHM_PAGEABLE flag set in accordance with shmat(2).
映射是 ISM 的“优化共享内存”(optimized shared memory, OSM) 的变体,使用 shmget_osm(2) 创建。
Ranges are reported as [ reserved ] and are created to prevent the kernel from choosing addresses within the Reserved range to satisfy non-fixed address memory mapping operations (mmap(2) and shmat(2)).固定地址映射操作可以在“保留的虚拟地址”范围的基础上进行映射,在这种情况下,映射名称将变为新映射的名称。当取消映射固定地址映射时,地址范围将恢复为 [ reserved ]。
与其他映射类型不同,“保留的虚拟地址”范围可以占用进程的地址空间中的任何位置,包括“无效的”位置,例如虚拟地址缺口。有关更多信息,请参见 memcntl(2) 中的 MC_RESERVE_AS。
Mappings created by using the CMI API are reported with the names shown below:
映射是一个本地 CMI 内存。报告用其创建映射的段句柄。
映射是一个远程 CMI 内存。报告用其创建映射的段句柄。
Mappings of other objects, including devices such as frame buffers.对于其他被映射的对象,没有显示映射名称。
用于该映射的硬件地址转换的页面大小(以千字节为单位)。See –scale.有关更多信息,请参见 memcntl(2) 手册页。
为该映射预留的交换空间量(以千字节为单位)。即,从由 swap –s 命令显示的总的可用预留交换空间池中扣除的交换空间。See –scale.有关更多信息,请参见 swap(8) 手册页。
缺省情况下,pmap 为目标进程的地址空间内的每个映射输出一行。以下示例显示了典型 shell 的地址空间。
example$ pmap $$ 3585: /usr/bin/ksh 0000000100000000 1728K r-x---- [ text ] /usr/bin/ksh 00000001001B0000 56K r-x---- [ text ] /usr/bin/ksh 00000001002BE000 8K rwx---- [ data ] /usr/bin/ksh 00000001002C0000 64K rwx---- [ data ] /usr/bin/ksh 00000001002D0000 16K rwx---- [ data ] /usr/bin/ksh 0000000100300000 24K rw----- [ bss ] /usr/bin/ksh 0000000EEBFC4000 8K rw----- [ heap ] 0007FCB434C00000 2176K r-x---- [ text ] /lib/sparcv9/libc.so.1 0007FCB434E20000 24K r-x---- [ text ] /lib/sparcv9/libc.so.1 0007FCB434F26000 80K rwx---- [ data ] /lib/sparcv9/libc.so.1 0007FCB434F3A000 40K rwx---- [ data ] /lib/sparcv9/libc.so.1 0007FCB435000000 704K r-x---- [ text ] /lib/sparcv9/libm.so.2 0007FCB4350B0000 56K r-x---- [ text ] /lib/sparcv9/libm.so.2 0007FCB4351BC000 16K rwx---- [ data ] /lib/sparcv9/libm.so.2 0007FCB435200000 256K r-x---- [ text ] /lib/sparcv9/ld.so.1 0007FCB4352F0000 128K rw----- [ anon ] 0007FCB435320000 64K rw----- [ anon ] 0007FCB435340000 8K r------ [ dtrace ] /lib/sparcv9/ld.so.1 0007FCB435370000 128K rw----- [ anon ] 0007FCB4353A0000 128K rw----- [ anon ] 0007FCB4353D0000 128K rw----- [ anon ] 0007FCB435400000 128K rw----- [ anon ] 0007FCB435430000 64K rw----- [ anon ] 0007FCB435442000 24K rwx---- [ data ] /lib/sparcv9/ld.so.1 0007FCB435448000 8K rwx---- [ data ] /lib/sparcv9/ld.so.1 0007FCB435460000 24K rw----- [ anon ] 0007FCB43546E000 8K rw-s--- [ anon ] 0007FCB435472000 8K r--s--- [ anon ] 0007FCB435476000 8K r--s--- [ anon ] 0007FCB43547A000 8K r--s--- [ anon ] 0007FCB43547E000 8K r-x---- [ anon ] FFFFFCFCE72A0000 64K rw----- [ stack ] FFFFFCFCE72B0000 40K rw----- [ stack ] total 6232K示例 2 显示内存分配和映射类型
可使用 –x 选项提供有关每个映射的内存分配和映射类型的信息。为每个映射显示了驻留的、非共享匿名的和锁定的内存量。
example$ pmap -x $$ 4022: /usr/bin/ksh Address Kbytes RSS Anon Lock Mode Mapped File 0000000100000000 1784 1704 - - r-x---- [ text ] ksh 00000001002BE000 88 88 72 - rwx---- [ data ] ksh 0000000100300000 24 16 16 - rw----- [ bss ] ksh 0000006AB975A000 8 - - - rw----- [ heap ] 0007FD56FE400000 2200 2200 - - r-x---- [ text ] libc.so.1 0007FD56FE726000 80 80 80 - rwx---- [ data ] libc.so.1 0007FD56FE73A000 40 24 24 - rwx---- [ data ] libc.so.1 0007FD56FE800000 760 760 - - r-x---- libm.so.2 0007FD56FE9BC000 16 16 16 - rwx---- libm.so.2 0007FD56FEA00000 256 256 - - r-x---- [ text ] ld.so.1 0007FD56FEB40000 8 8 - - r------ [ dtrace ] ld.so.1 0007FD56FEBD0000 64 64 64 - rw----- [ anon ] 0007FD56FEBF0000 128 128 128 - rw----- [ anon ] 0007FD56FEC1C000 8 8 - - rw-s--- [ anon ] 0007FD56FEC20000 128 128 128 - rw----- [ anon ] 0007FD56FEC42000 24 24 24 - rwx---- [ data ] ld.so.1 0007FD56FEC48000 8 8 8 - rwx---- [ data ] ld.so.1 0007FD56FEC60000 128 128 128 - rw----- [ anon ] 0007FD56FEC90000 128 128 128 - rw----- [ anon ] 0007FD56FECC0000 24 16 16 - rw----- [ anon ] 0007FD56FECD0000 64 64 64 - rw----- [ anon ] 0007FD56FECEA000 8 8 - - r--s--- [ anon ] 0007FD56FECEE000 8 8 - - r--s--- [ anon ] 0007FD56FECF2000 8 8 - - r--s--- [ anon ] 0007FD56FECF6000 8 8 - - r-x---- [ anon ] FFFFFD103AE20000 64 64 64 - rw----- [ stack ] FFFFFD103AE30000 24 24 24 - rw----- [ stack ] ---------------- ------ ---- ---- ---- total Kb 6088 5968 984 -
通过使用每个映射的驻留内存计数和匿名内存计数可以估算进程的每个附加实例使用的增量内存量。
在以上示例中,shell 进程的驻留内存大小为 5668 KB。但是,shell 使用的大量物理内存是与其他进程共享的。当多个进程运行同一程序时,它们会尽可能地相互共享物理内存,并为任何非共享部分分配匿名内存。在以上示例中,每个额外的 shell 进程大约使用 984 KB 的额外物理内存。
下面的较复杂示例显示了包含不同映射类型的进程的输出格式。在此示例中,映射如下所示。
可执行文本,从 'maps' 程序映射
可执行数据,从 'maps' 程序映射
程序堆
映射的文件,映射的 MAP_SHARED
映射的文件,映射的 MAP_PRIVATE
映射的文件,映射的 MAP_PRIVATE | MAP_NORESERVE
匿名内存,通过映射 /dev/zero 创建
匿名内存,通过使用 MAP_NORESERVE 映射 /dev/zero 创建
DISM 共享内存映射,使用 SHM_PAGEABLE 创建并锁定 8 MBmlock(3C)
DISM 共享内存映射,使用 SHM_PAGEABLE 创建,触动了其 4 MB 的页面
ISM 共享内存映射,使用 SHM_SHARE_MMU 创建,未触动其页面
ISM 共享内存映射,使用 SHM_SHARE_MMU 创建
远程 CMI 内存映射
本地 CMI 内存映射
example$ pmap -x 4095 4095: ./maps Address Kbytes RSS Anon Lock Mode Mapped File 00010000 8 8 - - r-x---- [ text ] maps 00020000 8 8 8 - rwx---- [ data ] maps 00022000 56 8 8 - rwx---- [ heap ] 03000000 1024 1024 - - rw-s--- dev:533,2 ino:631625786 04000000 1024 1024 512 - rw----- dev:533,2 ino:631625786 05000000 1024 1024 512 - rw--R-- dev:533,2 ino:631625786 06000000 1024 1024 1024 - rw----- [ anon ] 07000000 512 512 512 - rw--R-- [ anon ] 08000000 8192 8192 - 8192 rwxs--- [ dism shmid=0x0 ] 09000000 8192 8192 - - rwxs--- [ dism shmid=0x1 ] 0A000000 8192 8192 - 8192 rwxsR-- [ ism shmid=0x2 ] 0B000000 8192 8192 - 8192 rwxsR-- [ ism shmid=0x3 ] 0C000000 1048576 1048576 - - r--s--- [ cmi cmi_seg=0x3 (remote) ] 0D000000 262144 262144 - - rw-s--- [ cmi cmi_seg=0x2 ] FECA0000 2104 1848 - - r-x---- [ text ] libc.so.1 FEEBE000 48 48 48 - rwx---- [ data ] libc.so.1 FEECA000 24 16 16 - rwx---- [ data ] libc.so.1 FF370000 24 16 16 - rw----- [ anon ] FF380000 240 240 - - r-x---- [ text ] ld.so.1 FF3CC000 8 8 - - r------ [ dtrace ] ld.so.1 FF3D4000 32 24 24 - rw----- [ anon ] FF3DE000 16 16 16 - rwx---- [ data ] ld.so.1 FF3EE000 8 8 - - r--s--- [ anon ] FF3F2000 8 8 - - r--s--- [ anon ] FF3F6000 8 8 - - r--s--- [ anon ] FF3FA000 8 8 - - r-x---- [ anon ] FFBF0000 64 64 64 - rw----- [ stack ] -------- ------- ------- ---- ----- total Kb 40040 39712 2760 24576示例 3 显示页面大小信息
可以使用 –s 选项为地址空间的每一部分显示硬件转换页面大小。(有关 Solaris 多页面大小支持的详细信息,请参见 memcntl(2))。
在以下示例中,我们可以看到绝大部分映射使用 8 KB 的页面大小,而共享内存段使用 4 MB 的页面大小。
请注意,相同页面大小的驻留页面的非连续区域报告为单独的映射。在下面的示例中,libc.so 库被报告为多个单独的映射,因为只有部分 libc.so 文本是驻留的。
example$ pmap -xs 1840 1840: ./maps Address Kbytes RSS Anon Lock Pgsz Mode Mapped File 00010000 8 8 - - 8K r-x---- [ text ] maps 00020000 8 8 8 - 8K rwx---- [ data ] maps 00022000 8 8 8 - 8K rwx---- [ heap ] 00024000 48 - - - - rwx---- [ heap ] 03000000 1024 1024 - - 8K rw-s--- dev:533,2 ino:569519580 04000000 1024 1024 512 - 8K rw----- dev:533,2 ino:569519580 05000000 1024 1024 512 - 8K rw--R-- dev:533,2 ino:569519580 06000000 1024 1024 1024 - 64K rw----- [ anon ] 07000000 512 512 512 - 8K rw--R-- [ anon ] 08000000 8192 8192 - 8192 4M rwxs--- [ dism shmid=0x0 ] 09000000 8192 8192 - - 4M rwxs--- [ dism shmid=0x1 ] 0A000000 8192 8192 - 8192 4M rwxsR-- [ ism shmid=0x2 ] 0B000000 8192 8192 - 8192 4M rwxsR-- [ ism shmid=0x3 ] FECA0000 384 384 - - 64K r-x---- [ text ] libc.so.1 FED00000 256 64 - - - r-x---- [ text ] libc.so.1 FED40000 640 640 - - 64K r-x---- [ text ] libc.so.1 FEDE0000 128 128 - - - r-x---- [ text ] libc.so.1 FEE00000 64 64 - - 64K r-x---- [ text ] libc.so.1 FEE10000 128 64 - - - r-x---- [ text ] libc.so.1 FEE30000 320 320 - - 64K r-x---- [ text ] libc.so.1 FEE80000 128 128 - - - r-x---- [ text ] libc.so.1 FEEA0000 16 16 - - - r-x---- [ text ] libc.so.1 FEEA4000 40 40 - - 8K r-x---- [ text ] libc.so.1 FEEBE000 48 48 48 - 8K rwx---- [ data ] libc.so.1 FEECA000 8 - - - - rwx---- [ data ] libc.so.1 FEECC000 16 16 16 - 8K rwx---- [ data ] libc.so.1 FF370000 16 16 16 - 8K rw----- [ anon ] FF374000 8 - - - - rw----- [ anon ] FF380000 192 192 - - 64K r-x---- [ text ] ld.so.1 FF3B0000 48 48 - - 8K r-x---- [ text ] ld.so.1 FF3CC000 8 8 - - 8K r------ [ dtrace ] ld.so.1 FF3D4000 24 24 24 - 8K rw----- [ anon ] FF3DA000 8 - - - - rw----- [ anon ] FF3DE000 16 16 16 - 8K rwx---- [ data ] ld.so.1 FF3EE000 8 8 - - - r--s--- [ anon ] FF3F2000 8 8 - - - r--s--- [ anon ] FF3F6000 8 8 - - - r--s--- [ anon ] FF3FA000 8 8 - - - r-x---- [ anon ] FFBF0000 64 64 64 - 64K rw----- [ stack ] -------- ------ ----- ---- ----- total Kb 40040 39712 2760 24576示例 4 显示交换预留空间
可使用 –S 选项来描述进程的交换预留空间。将为进程内的每个映射显示预留的交换空间量。对于共享的映射,交换预留空间报告为零,因为这类预留空间仅在系统范围内计入一次。
example$ pmap -S 4220 4220: ./maps Address Kbytes Swap Mode Mapped File 00010000 8 - r-x---- [ text ] maps 00020000 8 8 rwx---- [ data ] maps 00022000 56 56 rwx---- [ heap ] 03000000 1024 - rw-s--- dev:533,2 ino:634348912 04000000 1024 1024 rw----- dev:533,2 ino:634348912 05000000 1024 512 rw--R-- dev:533,2 ino:634348912 06000000 1024 1024 rw----- [ anon ] 07000000 512 512 rw--R-- [ anon ] 08000000 8192 - rwxs--- [ dism shmid=0x0 ] 09000000 8192 - rwxs--- [ dism shmid=0x1 ] 0A000000 8192 - rwxsR-- [ ism shmid=0x2 ] 0B000000 8192 - rwxsR-- [ ism shmid=0x3 ] FECA0000 2104 - r-x---- [ text ] libc.so.1 FEEBE000 48 48 rwx---- [ data ] libc.so.1 FEECA000 24 24 rwx---- [ data ] libc.so.1 FF370000 24 24 rw----- [ anon ] FF380000 240 - r-x---- [ text ] ld.so.1 FF3CC000 8 - r------ [ dtrace ] ld.so.1 FF3D4000 32 32 rw----- [ anon ] FF3DE000 16 16 rwx---- [ data ] ld.so.1 FF3EE000 8 - r--s--- [ anon ] FF3F2000 8 - r--s--- [ anon ] FF3F6000 8 - r--s--- [ anon ] FF3FA000 8 - r-x---- [ anon ] FFBF0000 64 64 rw----- [ stack ] -------- ------ ---- total Kb 40040 3344
可以使用交换预留空间信息估算每个附加进程使用的虚拟交换量。每个进程都使用全局虚拟交换池中的虚拟交换。全局交换预留空间是由 swap(8) 命令的 'avail' 字段报告的。
示例 5 标记多线程进程中的栈example$ pmap 8703 8703: ./stacks 00010000 8K r-x---- [ text ] /tmp/stacks 00020000 8K rwx---- [ data ] /tmp/stacks 00022000 56K rwx---- [ heap ] FE79A000 8K rw--R-- [ stack tid=11 ] FE89A000 8K rw--R-- [ stack tid=10 ] FE99A000 8K rw--R-- [ stack tid=9 ] FEA9A000 8K rw--R-- [ stack tid=8 ] FEB9A000 8K rw--R-- [ stack tid=7 ] FEC9A000 8K rw--R-- [ stack tid=6 ] FECA0000 2048K r-x---- [ text ] /lib/libc.so.1 FEEA0000 56K r-x---- [ text ] /lib/libc.so.1 FEEBE000 48K rwx---- [ data ] /lib/libc.so.1 FEECA000 24K rwx---- [ data ] /lib/libc.so.1 FEFFA000 8K rw--R-- [ stack tid=5 ] FF0FA000 8K rw--R-- [ stack tid=4 ] FF1FA000 8K rw--R-- [ stack tid=3 ] FF200000 64K rw----- [ anon ] FF31A000 8K rw--R-- [ stack tid=2 ] FF320000 64K rw----- [ anon ] FF340000 128K rw----- [ anon ] FF370000 24K rw----- [ anon ] FF380000 192K r-x---- [ text ] /lib/ld.so.1 FF3B0000 48K r-x---- [ text ] /lib/ld.so.1 FF3C8000 8K rw----- [ altstack tid=8 ] FF3CC000 8K r------ [ dtrace ] /lib/ld.so.1 FF3D4000 32K rw----- [ anon ] FF3DE000 16K rwx---- [ data ] /lib/ld.so.1 FF3E6000 8K rw----- [ altstack tid=4 ] FF3EA000 8K rw-s--- [ anon ] FF3EE000 8K r--s--- [ anon ] FF3F2000 8K r--s--- [ anon ] FF3F6000 8K r--s--- [ anon ] FF3FA000 8K r-x---- [ anon ] FFBF0000 64K rw----- [ stack ]示例 6 显示 lgroup 内存分配
以下示例按映射显示 lgroup 内存分配。
example$ pmap -bL `pgrep nscd` 8629: /usr/sbin/nscd 000000B8886D6000 8K rw----- - [ heap ] 000000B8886D8000 32K rw----- 2 [ heap ] 000000B8886E0000 64K rw----- 2 [ heap ] 000000B8886F0000 256K rw----- 1 [ heap ] ... 0007FE2990700000 64K r-x---- 1 [ text ] libucrypto.so.1 0007FE2990710000 64K r-x---- 2 [ data ] libucrypto.so.1 ... 0007FE2995200000 8K r-x---- 1 [ text ] nss_dns.so.1 0007FE2995202000 16K r-x---- 2 [ text ] nss_dns.so.1 0007FE2995306000 8K rwx---- 2 [ data ] nss_dns.so.1 ... 0007FE2995800000 64K r-x---- 2 [ text ] nss_ldap.so.1 0007FE2995810000 16K r-x---- 2 [ text ] nss_ldap.so.1 0007FE2995914000 8K rwx---- 2 [ data ] nss_ldap.so.1 ... 0007FE2995C00000 16K r-x---- 1 [ text ] nss_files.so.1 0007FE2995C04000 32K r-x---- 2 [ text ] nss_files.so.1 0007FE2995D0C000 8K rwx---- 2 [ data ] nss_files.so.1 ... 0007FE2997300000 192K r-x---- 1 [ text ] ld.so.1 0007FE2997330000 64K r-x---- 2 [ text ] ld.so.1 0007FE2997440000 8K r------ - [ dtrace ] ld.so.1 0007FE2997542000 24K rwx---- 2 [ data ] ld.so.1 0007FE2997548000 8K rwx---- 2 [ data ] ld.so.1 0007FE2997600000 64K r-x---- 1 [ text ] nscd 0007FE2997610000 64K r-x---- 2 [ text ] nscd 0007FE2997620000 64K r-x---- 1 [ text ] nscd 0007FE2997630000 16K r-x---- - [ text ] nscd ... 0007FE2997734000 32K rwx---- 2 [ data ] nscd ... 0007FE299777C000 8K rw-s--- 2 [ anon ] 0007FE2997780000 64K rw----- 2 [ anon ] 0007FE2997796000 8K r-x---- - [ anon ] 0007FE299779E000 8K r--s--- 1 [ anon ] 0007FE29977A2000 8K r--s--- 1 [ anon ] 0007FE29977A6000 8K r--s--- - [ anon ] FFFFFE5DEF5F0000 16K rw----- - [ stack ] FFFFFE5DEF5F4000 8K rw----- 2 [ stack ] total 177264K
将返回以下退出值:
操作成功。
出现错误。
进程文件
proc 工具支持文件
有关下列属性的说明,请参见 attributes(7):
|
命令语法是 "Committed"(已确定)。–L 选项和输出格式是 "Uncommitted"(未确定)。
basename(1), ldd(1), lgrpinfo(1), madv.so.1(1), mdb(1), plgrp(1), pmadvise(1), proc(1), ps(1), memcntl(2), meminfo(2), mlock(3C), mmap(2), shmget_osm(2), shmop(2), dlopen(3C), proc(5), attributes(7), cmi(7), coreadm(8), prstat(8)、 swap(8)
Core files do not contain all the information present in the live running image of a process.For example, a segment of memory, reported by pmap as ISM in a running process, may be reported as heap when pmap is run against a core file from the same process.