tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Stevens" <>
Subject Re: Tomcat consuming entire CPU.
Date Wed, 25 Jul 2007 16:16:55 GMT
Thanks very much all for the advice,

I've managed to get my thread dumps nicely formatted side by side in
HTML using TDAN (Thread Dump Analyzer)

I'll work out how to then get thread ID's using 'ps' and then should
be in business.

I'm also going to speak with DBA about limiting Oracles(Database)
memory, and get Tomcat moved from was into RAM, I think this will help
general performance, but isn't the root cause.

Thanks again,


On 25/07/07, Juha Laiho <> wrote:
> Mark Stevens wrote:
> > I don't think we are using sendfile, to be honest, I've had no
> > involvement in development of the code, I'm just requested to look
> > after the server.
> >
> > I'm going to try and work out how to read thread dumps, hopefully this
> > will help, I'm finding my X11 connection too slow for J-Profiler to be
> > usable.
> Ok, some more details on what to look for (pretty much already
> said by Charles in an earlier message).
> When you encounter the CPU hogging situation, run (several times, if
> needed) such form of "ps" command that shows data on the individual
> threads. This'll give you the thread ID of the CPU-hungry thread (most
> possibly there is just one thread in this state), when you look at the
> CPU time used by thread - one is incrementing, others are not.
> Then run "kill -QUIT <tomcat_process_id>" to get the thread dump in
> catalina.out logfile.
> When you have the thread dump, you'll at least get a name of the thread
> and the Java method name being executed in the thread which is eating
> your CPU. This gives, if nothing else, a possibility to see whether
> the thread is looping in Java library code, application code, or Tomcat
> server code. A caveat on the data formats; at least on Linux platforms
> the thread ids from "ps" are in decimal, whereas in Java thread dump
> they are in hexadecimal, so you'll need to do a dec->hex conversion to
> the thread id from ps before searching in the thread dump.
> > Something else I noticed in my Live envrionment is that Oracle is
> > hogging all the memory and tomcat is being forced into swap.
> Oracle as in database - or application server? If database, then you'll
> need to get your DBA people to re-tune Oracle to leave some memory for
> others as well. If you're the DBA as well, see Oracle documentation on
> tuning SGA and db buffer cache sizes.
> --
> ..Juha
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message