1
votes

Too many threads on WAITING state in Tomcat. 50% threads is WAITING ON CONDITION

Tomcat 7. Cpu core 16. Cpu us82%. Memory is enough ,16g free space. There is only 1 fullgc in half a hour. Linux sys load is 50+,50+,50+, and 100+ some times. I never have ExecutorService or ThreadPool in my code.

"catalina-exec-682" daemon prio=10 tid=0x00007f530442e800 nid=0x16f8 waiting on condition [0x00007f51b9a3a000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000073168d480> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Locked ownable synchronizers: - None

"catalina-exec-681" daemon prio=10 tid=0x00007f530442c800 nid=0x16f7 waiting on condition [0x00007f51b9a7b000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000073168d480> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:104) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Locked ownable synchronizers: - None

I exprect there is no threads state is waiting on condition, all these threads are created by tomcat,but 50% is waiting ont condition.

1
Thanks for sharing. What is the question ?c0der
I do not know why so many threads on WAITING state in Tomcat, 50% threads stack is "org.apache.tomcat.util.threads.TaskQueue.take()"camus
Well, maybe because there was nothing for them to do when you checked?Martin James
This appears to be the tomcat thread pool. They don't do anything if they are not being used. You should be able to set the pool size to something smaller, but I don't expect this will make a difference.Peter Lawrey
Thank you very much! Everything is ok now,there is no problem.camus

1 Answers

0
votes

Well, maybe because there was nothing for them to do when you checked – Martin James

This appears to be the tomcat thread pool. They don't do anything if they are not being used. You should be able to set the pool size to something smaller, but I don't expect this will make a difference. – Peter Lawrey

Thank you for your answers, everything is ok, there is nothing wrong.