Several methods Linux / Centos view process memory size summary

1. Enter the top carriage return command line, and then press the sort memory according capital M, P is pressed by the CPU of sorting uppercase.

2. ps -ef | grep "process name"
    PS -e -o 'pid, COMM, args, pcpu, rsz, VSZ, stime, the User, uid' | grep process name
, for example:
# PS -ef | grep MongoDB | grep grep -v
? root 18512 1 8 Feb28 11:25:23 mongodb.conf the mongod -f
# PS -e -o 'pid, COMM, args, pcpu, rsz, VSZ, stime, the User, uid' | grep 18512 | grep grep -v
18512 8.0 6243952 mongodb.conf the mongod the mongod -f root 7,924,496 Feb28 0
 Note: 
pid: process ID of
vsz: process takes virtual memory
rsz: process takes physical memory

3. top -d 1 -p pid
example:
# -d 1 -p 18512 Top
Top - up 9 Days 13:18:41, 19:53, 3 the Users, the Load Average: 0.00, 0.00, 0.00
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.3%sy,  0.0%ni, 99.2%id,  0.0%wa,  0.0%hi,  0.3%si,  0.0%st
Mem:   8191244k total,  7929432k used,   261812k free,   122160k buffers
Swap: 20479996k total,    16232k used, 20463764k free,  1316248k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                       
18512 root      20   0 7738m 6.0g 5472 S  1.0 76.3 685:26.98 mongod     


4. pmap -x pid
例如:
# pmap -x 18512

Guess you like

Origin www.cnblogs.com/kofsony/p/11775397.html