1. pmap:
[root@test-01 ~]$ man pmap
PMAP(1) Linux User Manual PMAP(1)
NAME
pmap - report memory map of a process
SYNOPSIS
pmap [ -x | -d ] [ -q ] pids...
pmap -V
DESCRIPTION
The pmap command reports the memory map of a process or processes.
GENERAL OPTIONS
-x extended Show the extended format.
-d device Show the device format.
-q quiet Do not display some header/footer lines.
-V show version Displays version of program.
SEE ALSO
ps(1) pgrep(1)
STANDARDS
No standards apply, but pmap looks an awful lot like a SunOS command.
AUTHOR
Albert Cahalan
[root@test-01 ~]$sudo pmap -x 319
319: /usr/lib/nfs/nfsmapid
Address Kbytes RSS Anon Locked Mode Mapped File
00010000 16 16 - - r-x-- nfsmapid 代码段
00024000 8 8 8 - rwx-- nfsmapid 数据段
00026000 2200 216 216 - rwx-- [ heap ]
FE9FA000 8 8 8 - rw--R [ stack tid=4 ]
FEA00000 1024 64 - - rwx-- [ anon ]
FEB50000 24 24 - - r-x-- libgen.so.1
FEB66000 8 8 8 - rwx-- libgen.so.1
FEB70000 32 24 - - r-x-- libuutil.so.1
FEB88000 8 8 8 - rwx-- libuutil.so.1
...
每列的含义如下:
参数 解释
Address:0001000-0024000 进程所占的地址空间
Kbytes 该虚拟段的大小
RSS 设备号(主设备:次设备)
Anon 设备的节点号,0表示没有节点与内存相对应
Locked 是否允许swapped
Mode 权限:r=read, w=write, x=execute, s=shared, p=private(copy on write)
2. top
top -d 1
后shift + m