查看下进程下所有线程的统计情况
1:jps
2:打dump
ex: jstack 18159 > ./xxx.dump
3:线程分析
$ grep java.lang.Thread.State xxx.dump | awk '{print$2$3$4$5}'|uniq -c
或者
$ grep java.lang.Thread.State xxx.dump | awk '{print$2$3$4$5}'| sort | uniq -c
1 WAITING(onobjectmonitor)
1 TIMED_WAITING(onobjectmonitor)
1 RUNNABLE
1 TIMED_WAITING(parking)
14 TIMED_WAITING(onobjectmonitor)
1 RUNNABLE
1 TIMED_WAITING(sleeping)
3 RUNNABLE
10 WAITING(parking)
1 TIMED_WAITING(sleeping)
3 RUNNABLE
10 WAITING(parking)
1 TIMED_WAITING(sleeping)
2 RUNNABLE
1 TIMED_WAITING(onobjectmonitor)
1 TIMED_WAITING(parking)
3 RUNNABLE
1 TIMED_WAITING(parking)
6 RUNNABLE
2 WAITING(onobjectmonitor)
1 RUNNABLE