Hello,
I maintain a server running JServ, with many servlets created by other
developers. Once in a while one of the servlets gets stuck in an
infinite loop, and I'd like to know which servlet (or servlets) are
causing this.
How can I tell which thread in the JVM is stuck in a loop, preferably
with a stack trace so that I can debug the offending class?
The server is running Debian Linux, with JDK 1.4.2_12, JServ 1.1.2, and
apache 1.3 acting as a front-end for JServ.
I've tried creating a "debug" servlet that lists all of the threads
using Thread.enumerate and Thread.dumpStack, but that only shows threads
for my servlet, and nothing else. In Linux, "ps" only shows the main
java process, using 100% CPU, but not the threads inside java.
Any suggestions?
Thanks,
Nathan
Bart Cremers - 08 Dec 2006 07:26 GMT
> Hello,
>
[quoted text clipped - 19 lines]
>
> Nathan
You can send a SIGQUIT to the java process, which will give you a full
thread dump in the standard output of the process.
kill -3 <pid-of-java-process>
or
kill -QUIT <pid-of-java-process>
Regards,
Bart
Ed - 08 Dec 2006 20:17 GMT
Nathan skrev:
> Hello,
>
[quoted text clipped - 19 lines]
>
> Nathan
Well, it won't show you which thread is causing the problem, but it
will show you all threads running on the server; maybe comparisons
before and after the hangings will help:
http://qa.netbeans.org/bugzilla/generating-thread-dumps.html
.ed
--
www.EdmundKirwan.com - Home of The Fractal Class Composition