tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Seaver <>
Subject Re: [Fwd: Catalina suspends for no reason?!?]
Date Mon, 09 Feb 2004 19:48:12 GMT

Shapira, Yoav wrote:

>>So basically, I iknow this is off-topic for a tomcat-users page, but if
>>I wanted to track down all the threads that are opened within the JVM
>>any one time, and the nature of the threads (ie Daemon etc.) and where
>>they come from etc. can I do this?
>Sure.  If you send a SIGQUIT to the JVM at any point, including when it
>appears hung, you will get a listing on your screen (or wherever you
>have stdout directed) of all the currently running JVM threads and what
>they're doing.  I don't think that screen tells you if a given thread is
>a daemon.
My first problem is the definition of the JVM, i cant find it as a 
process in its own right, I can only find the process for catalina, 
sending a SIGQUIT to:

-Djava.endorsed.dirs=/usr/local/tomcat/common/endorsed -classpath 

isn't doing anything, but I cant seem to find the JVM process??
so i tried your alternative..

>Alternatively, you can produce this information programmatically.  I've
>posted code to the list in the past that does this (I think it was
>called SystemThreadList or something like that).  It's a simple
>recursive approach:
>// Find root threadgroup
>Thread thisThread = Thread.currentThread();
>ThreadGroup tg = thisThread.getThreadGroup();
>while(tg.getParent() != null) {
>  tg = tg.getParent();
>// Get all threads
>int estimate = 2 * tg.activeCount();
>Thread[] allThreads = new Thread[estimate];
Sure enough, in its own little progam it prints out all the threads.  
But I obviously need to embed it in Catalina somewhere, should I create 
a bean that does this??


>Now you list all threads, check daemon status, check the class (in case
>it's a specific subclass extending Thread that you're looking for), etc.
>Yoav Shapira
>This e-mail, including any attachments, is a confidential business communication, and
may contain information that is confidential, proprietary and/or privileged.  This e-mail
is intended only for the individual(s) to whom it is addressed, and may not be saved, copied,
printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the sender.  Thank you.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message