Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / December 2006

Tip: Looking for answers? Try searching our database.

Listing all threads

Thread view: 
Nathan - 08 Dec 2006 01:20 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.