Linux-linux view process memory cpu/zombie process/dead process

1.top/htop

View memory, cpu / q exit

 

2.ps view all current processes

ps -ef

ps -ef | grep python

ps -aux

 

3. Linux zombie process troubleshooting

#yum install -y htop iotop smem

#View the amount of memory used by the process

smem -k -s uss

#View the internal percentage used by the process

smem -p -s uss

#View the amount of memory used by each user

smem -u -k

#View the amount of memory used by a single process

smem -P ./perf -k

#Get the 10 processes with the largest memory usage

ps aux | head -1; ps aux | sort -nr -k4 | head -10

#Get the 10 processes with the largest CPU usage

ps aux | head -1; ps aux | sort -nr -k3 | head -10

#Find zombie processes

ps -e -o stat, ppid, pid, cmd | grep -e '^[zZ]'

#Kill the dead process

ps -e -o stat,ppid,pid,cmd|grep -e '^[zZ]'|awk '{print $2}'|xargs kill -9

 

Guess you like

Origin blog.csdn.net/helunqu2017/article/details/113822971