On 19/10/2010 16:40, André Warnier wrote: > Hi. > > I have a Linux system like so : > > Linux arthur 2.6.26-2-686 #1 SMP Mon Aug 30 07:01:57 UTC 2010 i686 > GNU/Linux > > with a tomcat like so : > > Using CATALINA_BASE: /usr/share/tomcat5.5 > Using CATALINA_HOME: /usr/share/tomcat5.5 > Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp > Using JRE_HOME: /usr/lib/jvm/java-1.5.0-sun > Server version: Apache Tomcat/5.5 > Server built: Oct 15 2008 12:57:44 > Server number: 5.5.26.0 > OS Name: Linux > OS Version: 2.6.26-2-686 > Architecture: i386 > JVM Version: 1.5.0_22-b03 > JVM Vendor: Sun Microsystems Inc. > > (Java JDK installed) > > and where night and day, tomcat seems to be using a fair amount of CPU > time, like so : > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 2901 tomcat55 20 0 459m 285m 16m S 13 32.3 354:39.13 java > > although by all means, it should not be doing that much sometimes. > > How can I figure out what it is actually doing ? > I mean, which is the easiest standard tool or procedure not requiring a > degree in quantum physics, and which could give me at least a rough idea > of which webapp or internal tomcat process is keeping that CPU busy all > the time ? > > I have a nagging feeling that someone is going to tell me to take thread > dumps. If so, maybe they would also kindly point out a place where I > could find some instructions as to how to interpret such a thing ?
You can take sequential dumps and compare states to find out which threads are busy and what they're doing. Look at the thread stacks and see what the code is doing. You can discard idle threads. You're looking to see which threads are active and in which bit of code they are spending time. (Unless something is blocked a single thread dump is of limited use.) You could also attach a JConsole or a profiler and monitor the threads to see what they're doing. Java 6 has better tools for this, though there's a independant download of VisualVM which may work too. p > Thanks > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >
0x62590808.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature