Dynamically view memory usage for a process
Copy Code code as follows:
1. Top command
top-d 1-p pid [, pid ...]//set to delay 1s, default is delay 3s
If you want to sort by memory usage, you can shift + m (sort by memory usage)
Static view of memory usage for a process
Copy Code code as follows:
1, Pmap command
Pmap PID
2. PS command
PS Aux|grep process_name
3, view the status file under the/proc/process_id/folder
name:php
State:r (running)
sleepavg:0%
tgid:21574
pid:21574
ppid:10005
tracerpid:0
uid:1000 1000 1000 1000
GID:100 100 100 100
fdsize:256
Groups:16 100
vmpeak:161740 KB
vmsize:161740 KB
vmlck:0 KB
vmhwm:107144 KB
vmrss:107144 KB
vmdata:106192 KB
vmstk:84 KB
vmexe:5588 KB
vmlib:7884 KB
vmpte:268 KB
Threads:1
sigq:0/69632
sigpnd:0000000000000000
shdpnd:0000000000000000
sigblk:0000000000000000
sigign:0000000000001000
Sigcgt:00000001818040a7
capinh:0000000000000000
capprm:0000000000000000
capeff:0000000000000000
cpus_allowed:00000000,00000000,00000000,0000000f
Mems_allowed:1
The size of the task virtual address space Vmsize
The size of the physical memory the application is using Vmrss