目录
1.查看指定进程的PID
2.用top命令指定固定的PID
3.使用ps查询指定进程名或PID的占用情况
4.查看更详细的内存占比
1.查看指定进程的PID
ps -ef | grep iquota-server
2.用top命令指定固定的PID
top -p 3664
3.使用ps查询指定进程名或PID的占用情况
ps -aux | grep iquota-server
或:263539008
ps -aux | grep 3664
其中,
3664为PID
4.3为CPU占用百分比(注意:如果有两个CPU,32核64线程,那么总占比是6400%)
2.9为内存占用百分比,7848800为该进程使用内存(kb),总的内存可以使用top命令查看,如下:
4.查看更详细的内存占比
cat /proc/3664/status
返回结果:(其中VmRSS为进程所占用的内存)
Name: javaUmask: 0022State: S (sleeping)Tgid: 24852Ngid: 0Pid: 24852PPid: 1TracerPid:0Uid: 0 0 0 0Gid: 0 0 0 0FDSize: 512Groups: 0 NStgid: 24852NSpid: 24852NSpgid: 24720NSsid: 24720VmPeak: 22110836 kBVmSize: 22032508 kBVmLck: 0 kBVmPin: 0 kBVmHWM: 9972672 kBVmRSS: 9968432 kBRssAnon: 9947648 kBRssFile: 20784 kBRssShmem: 0 kBVmData: 11418068 kBVmStk: 140 kBVmExe: 4 kBVmLib:16120 kBVmPTE:20780 kBVmPMD: 96 kBVmSwap: 0 kBHugetlbPages:0 kBThreads: 96SigQ: 3/767318SigPnd: 0000000000000000ShdPnd: 0000000000000000SigBlk: 0000000000000000SigIgn: 0000000000000003SigCgt: 2000000181005cccCapInh: 0000000000000000CapPrm: 0000003fffffffffCapEff: 0000003fffffffffCapBnd: 0000003fffffffffCapAmb: 0000000000000000NoNewPrivs:0Seccomp: 0Speculation_Store_Bypass: vulnerableCpus_allowed: ffffff,ffffffffCpus_allowed_list:0-55Mems_allowed: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003Mems_allowed_list:0-1voluntary_ctxt_switches: 1nonvoluntary_ctxt_switches:1
参考:/EasonJim/p/8040782.html