How to view the actual memory footprint of a process
Last Update:2018-07-25
Source: Internet
Author: User
The top command can view the use of process memory, but is not detailed enough. There are also commands that can be viewed in more detail.
[Root@localhost ~]# Cat/proc/5606/status
Name:switch4
State:s (sleeping)
tgid:5606
pid:5606
Ppid:1
tracerpid:0
uid:0 0 0 0
gid:0 0 0 0
utrace:0
Fdsize:32
groups:0 1 2 3 4 6 10
vmpeak:85328 KB
vmsize:84308 The amount of virtual memory consumed by the kb--process.
vmlck:0 KB
vmhwm:46368 KB
The physical memory occupied by the vmrss:46360 kb--.
VMDATA:76512 kb--data Segment Memory size (bss,data)
vmstk:88 kb--stack size.
vmexe:312 kb--code segment size.
vmlib:6868 kb--Library Size
vmpte:148 KB
vmswap:0 KB
Threads:4
sigq:1/31237
sigpnd:0000000000000000
shdpnd:0000000000000000
sigblk:0000000000000000
sigign:0000000000000005
sigcgt:0000000180005202
capinh:0000000000000000
Capprm:ffffffffffffffff
Capeff:ffffffffffffffff
Capbnd:ffffffffffffffff
Cpus_allowed:ff
Cpus_allowed_list:0-7
Mems_allowed:1
mems_allowed_list:0
voluntary_ctxt_switches:116683469
nonvoluntary_ctxt_switches:301173
[Root@localhost ~]# Cat/proc/5627/smaps
00110000-00112000 R-xp 00000000 08:02 652817/home/mic_lib_2012-04-21-03-16-32/libdb.so
Size:8 KB
Rss:8 KB
Pss:1 KB
Shared_clean:8 KB
shared_dirty:0 KB
private_clean:0 KB
private_dirty:0 KB
Referenced:8 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
00112000-00113000 rw-p 00001000 08:02 652817/home/mic_lib_2012-04-21-03-16-32/libdb.so
Size:4 KB
Rss:4 KB
Pss:4 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
Private_dirty:4 KB
Referenced:4 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
08048000-080a2000 R-xp 00000000 08:02 1044485/HOME/EXECUTE_2012-04-21-03-16-32/MRFC
size:360 kb--Virtual Memory
rss:156 kb--Physical Memory
pss:156 KB
shared_clean:0 kb--shared section, Dynamic link library
shared_dirty:0 KB
private_clean:156 kb--Private part.
private_dirty:0 KB
referenced:156 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
09f43000-09f87000 Rw-p 00000000 00:00 0 [heap]--heap memory
size:272 KB
rss:184 KB
pss:184 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
private_dirty:184 KB
referenced:184 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
b6cfc000-b6cfd000---P 00000000 00:00 0
Size:4 KB
rss:0 KB
pss:0 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
private_dirty:0 KB
referenced:0 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
b6cfd000-b7703000 Rw-p 00000000 00:00 0
size:10264 KB
Rss:28 KB
Pss:28 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
Private_dirty:28 KB
Referenced:28 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
b7714000-b7716000 Rw-p 00000000 00:00 0
Size:8 KB
Rss:8 KB
Pss:8 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
Private_dirty:8 KB
Referenced:8 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB
bfed4000-bfee9000 Rw-p 00000000 00:00 0 [stack]--stack of memory.
size:88 KB
Rss:44 KB
Pss:44 KB
shared_clean:0 KB
shared_dirty:0 KB
private_clean:0 KB
Private_dirty:44 KB
Referenced:44 KB
swap:0 KB
Kernelpagesize:4 KB
Mmupagesize:4 KB