linux下查看进程内存的方法
2021-12-15 本文已影响0人
小白兔胡萝卜
场景一
现有一个进程id为「11529」,想要查询该进程占用的内存大小。
常见方法
方法一:cat /proc/11529/status
方法二:pmap -x 11529
方法三:top -n 1 | grep 11529 | awk '{print $5}'
方法四:ps -e -o 'pid,comm,args,pcpu,rsz,vsz,stime,user,uid' | grep 11529 | awk '{print $5}'
场景二
现有一个进程name为「sensechess-app」,想要查询该进程占用的内存大小。
sysMonitor监控工具
自开发的的脚本工具 - sysMonitor.zip,可监控系统或者某个进程的CPU、MEM、DISK的使用情况.
示例:
![](https://img.haomeiwen.com/i1026028/3e128ce3d56bf2fc.png)