jstack命令

root@iZ0z00b09p3thwZ:~# jstack 13773
2017-07-07 21:34:20
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode):

"Attach Listener" #20 daemon prio=9 os_prio=0 tid=0x00007fbf90001000 nid=0x360c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"DestroyJavaVM" #19 prio=5 os_prio=0 tid=0x00007fbfb8007800 nid=0x35ce waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"SimpleTask2" #18 prio=5 os_prio=0 tid=0x00007fbfb8115000 nid=0x35de waiting on condition [0x00007fbfa6a29000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at com.cyb.thread.SimpleTask.run(SimpleTask.java:33)
	at java.lang.Thread.run(Thread.java:748)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

"SimpleJoinTask" #17 prio=5 os_prio=0 tid=0x00007fbfb8113800 nid=0x35dd waiting on condition [0x00007fbfa6b2a000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000000f008a778> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
	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 java.lang.Thread.run(Thread.java:748)

"SimpleTask1" #15 prio=5 os_prio=0 tid=0x00007fbfb8112000 nid=0x35dc waiting on condition [0x00007fbfa6c2b000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep(Native Method)
	at com.cyb.thread.SimpleTask.run(SimpleTask.java:33)
	at java.lang.Thread.run(Thread.java:748)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

"返回值线程测试2" #12 prio=5 os_prio=0 tid=0x00007fbfb810f800 nid=0x35db waiting on condition [0x00007fbfa6d2c000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x00000000f0088410> (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.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
	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 java.lang.Thread.run(Thread.java:748)

"王五-inpool" #11 prio=5 os_prio=0 tid=0x00007fbfb810d800 nid=0x35da waiting for monitor entry [0x00007fbfa6e2d000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:97)
	- waiting to lock <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	- locked <0x00000000f006d0e8> (a com.cyb.thread.Fork)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

"李四-inpool" #10 prio=5 os_prio=0 tid=0x00007fbfb810c000 nid=0x35d9 waiting for monitor entry [0x00007fbfa6f2e000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:72)
	- waiting to lock <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

"老李#" #9 prio=5 os_prio=0 tid=0x00007fbfb8106800 nid=0x35d8 waiting for monitor entry [0x00007fbfa702f000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:72)
	- waiting to lock <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	at java.lang.Thread.run(Thread.java:748)

"小陈#" #8 prio=5 os_prio=0 tid=0x00007fbfb8105800 nid=0x35d7 waiting for monitor entry [0x00007fbfa7130000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:79)
	- waiting to lock <0x00000000f006d0e8> (a com.cyb.thread.Fork)
	- locked <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	at java.lang.Thread.run(Thread.java:748)

"Service Thread" #7 daemon prio=9 os_prio=0 tid=0x00007fbfb80a7000 nid=0x35d5 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x00007fbfb80a3800 nid=0x35d4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007fbfb80a1800 nid=0x35d3 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007fbfb809f800 nid=0x35d2 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007fbfb8078000 nid=0x35d1 in Object.wait() [0x00007fbfa7a0e000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000f0008ec8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
	- locked <0x00000000f0008ec8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007fbfb8073800 nid=0x35d0 in Object.wait() [0x00007fbfa7b0f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000000f0006b68> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:502)
	at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
	- locked <0x00000000f0006b68> (a java.lang.ref.Reference$Lock)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"VM Thread" os_prio=0 tid=0x00007fbfb806c000 nid=0x35cf runnable 

"VM Periodic Task Thread" os_prio=0 tid=0x00007fbfb80ae800 nid=0x35d6 waiting on condition 

JNI global references: 22


Found one Java-level deadlock:
=============================
"王五-inpool":
  waiting to lock monitor 0x00007fbf980062c8 (object 0x00000000f006b9c8, a com.cyb.thread.Knife),
  which is held by "小陈#"
"小陈#":
  waiting to lock monitor 0x00007fbf98003828 (object 0x00000000f006d0e8, a com.cyb.thread.Fork),
  which is held by "王五-inpool"

Java stack information for the threads listed above:
===================================================
"王五-inpool":
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:97)
	- waiting to lock <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	- locked <0x00000000f006d0e8> (a com.cyb.thread.Fork)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
"小陈#":
	at com.cyb.thread.TestDeadLock.run(TestDeadLock.java:79)
	- waiting to lock <0x00000000f006d0e8> (a com.cyb.thread.Fork)
	- locked <0x00000000f006b9c8> (a com.cyb.thread.Knife)
	at java.lang.Thread.run(Thread.java:748)

Found 1 deadlock.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值