tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lindsay Patten <>
Subject 100% cpu usage by "VM Thread" in tomcat
Date Fri, 21 Sep 2007 17:11:36 GMT
I am looking for information on how to debug a problem. Any pointers to 
documentation, suggestions of approaches etc. would be much appreciated.

I am having a problem with my tomcat server periodically going into a 
state where it is using up all the available cpu and providing very slow 
response.  None of the jsp or servlets on the site should take up a lot 
of cpu, they all just do relatively simple database queries and produce 
simple html pages from the results.  During the times when the cpu is 
busy the database will generally not be under any significant load.

Top shows process 324 (0x144) as the busy process, and ps shows it 
having consumed a lot of cpu:
  324 ?        S    837:41 /usr/java/jdk1.5.0_10/bin/java -Djava...

Expecting to find that I had some error in my webapp I did a few thread 
dumps, but assuming that nid in the thread dump corresponds to pid from 
ps I found that the process that was spinning was "VM Thread":

"VM Thread" prio=1 tid=0x08098a48 nid=0x144 runnable

The thread dump does not give any additional information about this 
thread. I presume it is the Virtual Machine itself.

If I look at the system status using the Tomcat manager webapp there are 
often requests listed with ridiculously large values in the Time column, 
several hundred seconds for jsp pages that only take a fraction of a 
second to generate, and I can cut an paste the request into my browser 
and the request will finish in a fraction of a second.

Sometimes it seems that reloading some of the webapps can "fix" the 
problem, at least for a while - I don't know for sure, it could be 
coincidence, but if I don't do anything the problem can persist for long 
periods of time and then go away after a few webapp reloads.  I have 
tried to detect a pattern about which app reload solves the problem but 
it seems to be different different times.  vmstat doesn't show the 
machine as thrashing or using much IO (everything basically fits into 
physical memory).  The only thing I can think of is that the VM is going 
into a marathon garbage collection phase, but I don't know how to test 
that hypothesis, and it seems odd that even that could go on for lengthy 
periods of time.


JVM: jdk1.5.0_10
Tomcat: apache-tomcat-6.0.13
uname -a: Linux [hostname here] 2.4.34-grsec #27 SMP Mon Jan 22 21:19:29 
CST 2007 i686 unknown

The system is a two cpu system with 4GB RAM, and when not in this 
spinning state it handles its load with 10-15% cpu load.

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

View raw message