查看线程数的总量
1.ps -o nlwp PID
2.cat /proc/PID/status |grep -i thread
3.ll /proc/PID/task |wc -l (算出来数量减1,当前所在文件夹也会算进去)
nlwp含义是number of light-weight process。
ps -o nlwp 27989
获得真正在running的线程数量
ps -eLo pid ,stat | grep 27989 | grep running | wc -l
Sl表示大多数线程都处于空闲状态
统计应用线程数 jstack 2702 | grep java.lang.Thread.State | awk '{print $2}' | sort | uniq -c
网友评论