shell分析线程堆栈
Posted daomeidan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell分析线程堆栈相关的知识,希望对你有一定的参考价值。
找出java进程id ps aux|grep xxxxxx 使用jstack命令打印线程堆栈信息 jstack 7363 java线程数统计 jstack 7363|grep java.lang.Thread.State: -c 线程各种状态统计 jstack 7363|grep java.lang.Thread.State: |sort|uniq -c 34 java.lang.Thread.State: RUNNABLE 3 java.lang.Thread.State: TIMED_WAITING (on object monitor) 8 java.lang.Thread.State: TIMED_WAITING (parking) 9 java.lang.Thread.State: TIMED_WAITING (sleeping) 2 java.lang.Thread.State: WAITING (on object monitor) 73 java.lang.Thread.State: WAITING (parking) 第一列作为数字降序排序 jstack 7363|grep java.lang.Thread.State: |sort|uniq -c|sort -rn -k 1 75 java.lang.Thread.State: WAITING (parking) 34 java.lang.Thread.State: RUNNABLE 9 java.lang.Thread.State: TIMED_WAITING (sleeping) 8 java.lang.Thread.State: TIMED_WAITING (parking) 3 java.lang.Thread.State: TIMED_WAITING (on object monitor) 2 java.lang.Thread.State: WAITING (on object monitor)
以上是关于shell分析线程堆栈的主要内容,如果未能解决你的问题,请参考以下文章