"http-nio-8601-Acceptor" #32 daemon prio=5 os_prio=0 tid=0x0000000060c49800 nid=0x824 runnable [0x00000000648de000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250) - locked <0x00000000e0c3b670> (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:463) at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:73) at org.apache.tomcat.util.net.Acceptor.run(Acceptor.java:95) at java.lang.Thread.run(Thread.java:745) ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 17063 root 20 0 2525764 138224 12788 S 0.0 7.3 0:00.00 java 17065 root 20 0 2525764 138224 12788 S 0.0 7.3 0:02.62 java 17067 root 20 0 2525764 138224 12788 S 0.0 7.3 0:05.73 java 17068 root 20 0 2525764 138224 12788 S 0.0 7.3 0:00.00 java 17069 root 20 0 2525764 138224 12788 S 0.0 7.3 0:00.00 java 17070 root 20 0 2525764 138224 12788 S 0.0 7.3 0:00.00 java 17071 root 20 0 2525764 138224 12788 S 0.0 7.3 0:07.06 java 17072 root 20 0 2525764 138224 12788 S 0.0 7.3 0:01.59 java 17073 root 20 0 2525764 138224 12788 S 0.0 7.3 0:00.00 java
可以看到CPU占用高的百分比
windwos可以使用ProcessExplorer软件进行查看
4、将线程ID转为16进制,因为线程dump的线程ID是使用16进制的。
1 2 3
43404 --> A98C
// 搬运者注:Linux下,通过`printf"%x\n" tid`命令转换从十六进制
5、去之前dump的线程映像中查看对应线程
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
"Catalina-utility-1" #17 prio=1 os_prio=-2 tid=0x000000006130b000 nid=0xa98c waiting on condition [0x000000005e7be000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000e358e9a0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)