In some rare exceptions, the JVM may have threads that are not progressing, possibly because of one of the following reasons:
You can often find these offending threads by taking several successive thread dumps and seeing if there are any threads that seem "stuck" in the same processing point. On Unix and Linux, issue the following command where pid is the process id of the JVM:
# kill -3 pid
In Windows, you have to press the CTRL+BREAK keys on the command window that started the JVM.
If you have a hanging or deadlocked thread, in the best case, all they do is tie up a number of scarce worker (execute) threads. There currently isn't any way to kill hung or deadlock threads except to schedule a restart of the JVM.
In the worst case, these offending threads hold on to crucial shared resources (such as database record locks) and are blocking other threads in this or other JVMs. This situation could lead to a system-wide slowdown as more and more threads block behind these offending threads.
If you have infinite looping threads, at best, all they do is make the server node busier. In the worst case, they start to impact the performance of transaction running in that node or they hold critical resources needed by other threads.
Recommendations:
If you suspect a JVM has a hung or looping thread:
The download page contains excellent information about using the tool for analysis and troubleshooting.
If you suspect transactions are slow across many JVMs: