Riz,

> Quick question, when you look at a thread dump, how do you tell which
> threads are idle?

Idle threads are ones that are not handling any requests. That seems
kind of self-explanatory, but you have to understand what those threads
are doing when they are not doing anything else: they are waiting for a
request to come in in order to service it.

Tomcat uses a thread pool to service requests. When they aren't doing
anything, they have to actually be "waiting". They are blocked waiting
for a notification that there's something to do.

This is what they look like when they are in that state:

"http-443-Processor26" daemon prio=1 tid=0xb2affd98 nid=0x2515 in
Object.wait() [0x06289000..0x06289f40]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x54ef76c0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Object.wait(Object.java:474)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:656)
        - locked <0x54ef76c0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Thread.run(Thread.java:595)


There are 3 things to note:

1) The status of the thread is "in Object.wait()". Compare this to other
   threads whose state is "runnable". This means that the thread has
   called Object.wait and is waiting for another thread to call
   Object.notify on whatever object is being wait()ed.

2) The object being wait()ed on is
   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable
   and the method being run is "run" in that same object.
   You can see that they are the same object because the thread dump
   says "waiting on <0x54ef76c0>" and then, further down, it says
   "locked <0x54ef76c0>". That means that the code is in a synchronized
   block and waiting on that very same object.

3. Everything is tied up in Tomcat's ThreadPool code. That means that
   the thread is waiting to be taken out of the pool to service a
   request.

> Also, any inputs on my other postings regarding the session count and
> catalina.out logging?
> 
> http://mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/[EMAIL 
> PROTECTED]

You can't roll catalina.out. I read that thread, and the response you
got that said "don't log to stdout" was right: just don't do it. Since
you are using log4j already, have log4j log to a different log file that
/does/ roll. You shoudln't have any System.out or System.err usage in
your webapp.

> http://mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/[EMAIL 
> PROTECTED]

I'll answer this one separately. Look for a followup post.

-chris


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to