0
我在運行一個碼頭應用程序中有很多這樣的線程。我想知道我該如何調試出錯的地方。如何調試線程等待問題?
2011-11-30 18:25:52
Full thread dump OpenJDK Client VM (19.0-b09 mixed mode, sharing):
"pool-34193-thread-1" prio=10 tid=0xac634800 nid=0x515 waiting on condition [0xaaf2c000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x6429b8c0> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
"pool-34189-thread-1" prio=10 tid=0xac3f8400 nid=0x512 waiting on condition [0xaf766000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x64177778> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
"pool-34187-thread-1" prio=10 tid=0xac63c800 nid=0x511 waiting on condition [0xab349000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x64f78728> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
"pool-34176-thread-1" prio=10 tid=0xac630000 nid=0x510 waiting on condition [0xab48d000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x6421b7e8> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:453)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:352)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:903)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
@Peter, 他們中的很多似乎在等待鎖
"qtp26356569-17296" prio=10 tid=0xb3c09800 nid=0x2932 waiting on condition [0x9c762000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x714e4798> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2081)
at org.eclipse.jetty.util.BlockingArrayQueue.poll(BlockingArrayQueue.java:320)
at org.eclipse.jetty.util.thread.QueuedThreadPool.idleJobPoll(QueuedThreadPool.java:512)
at org.eclipse.jetty.util.thread.QueuedThreadPool.access$600(QueuedThreadPool.java:38)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:558)
at java.lang.Thread.run(Thread.java:636)
請給我們完整的線程轉儲請(可能是匿名)。也請看[tda](http://java.net/projects/tda) –
你爲什麼認爲事情出錯了?看起來你有很多無關的線程(等待傳入的請求) –