mysql2:~ #top
Shift+p 按照cpu排序
找到cpu最高进程pid 28324
mysql2:~ #top -H -p 28324
找到cpu最高的线程tid 31218
mysql2:~ #printf "%x
" 31218
79f2
转换线程为16进制
mysql2:~ #jstack 28324 | grep -A 10 "79f2" "ContainerBackgroundProcessor[StandardEngine[Catalina]]" #49 daemon prio=5 os_prio=0 tid=0x00007fa27c1c1800 nid=0x79f2 waiting on condition [0x00007fa2609d2000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1359) at java.lang.Thread.run(Thread.java:748) "WebSocketTimer" #47 daemon prio=5 os_prio=0 tid=0x00007fa21c007000 nid=0x79c2 in Object.wait() [0x00007fa2591ff000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at java.util.TimerThread.mainLoop(Timer.java:552) - locked <0x00000000a5f913c8> (a java.util.TaskQueue)
在dump中,线程一般存在如下几种状态:
1、RUNNABLE,线程处于执行中
2、BLOCKED,线程被阻塞
3、WAITING,线程正在等待