My instance of JBoss is subjected to external scanning to check for vulnerabilities, and after these scans it often ends up in a state in which it seems to work fine, but uses just over 100% of a CPU (on a 4 CPU box) thereafter. I'd like to avoid this unnecessary CPU load.
The first thing I did to investigate was to use the JMX console to look at the thread CPU usage. That showed that threads named pool-2-thread-2 through pool-2-thread-13 had very high CPU time (e.g. 2917560 ms and rising), so it's clear that these are the problems. (But pool-2-thread-1 had only 1490 ms used, for some reason.)
Oddly, when I ask the same MBean to display a thread dump, these threads seem not to be there. So I obtained a thread dump using kill -3 uid (it's on a Linux box) . To avoid cluttering things up I have included that dump as an attachment rather than pasting it all here. However, here is a sample of one of these threads. It seems to be typical of this pool-2-thread-x group except that thread-4 is "runnable" rather than "waiting on condition".
"pool-2-thread-13" prio=10 tid=0x082e4000 nid=0x58dc waiting on condition [0xbed9e000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0xd8a9ce60> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
But having got this far I'm not sure how to proceed. If anyone has any ideas (other than telling my company to quit being so paranoid and to lay off the scanning) I'd love to hear them.
ThreadDump.txt.zip 4.9 KB