James Lampert | 20 Jun 17:45 2012

High CPU usage in Tomcat 7

We just had a report of some honking high CPU usage from one of our 
customer Tomcat installations.

We terminated and restarted the CATALINA job; The only screen shot I 
have of a WRKACTJOB while the problem was occurring shows:
CATALINA   BCH     .0  CMD-QSH          TIMW
QP0ZSPWT   BCI  112.2  JVM-org.apache   TIMW

I did a Google search on "tomcat 7 high cpu usage"; what I got back 
suggests profilers and thread dumps, to find the offending thread. How 
would I do this on an AS/400?


This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: JAVA400-L@...
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@...
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.

Joe Sam Shirah | 22 Jun 00:26 2012

Re: High CPU usage in Tomcat 7

    Hi James,

    I didn't see any responses to your mail.  You can google for various
profilers and monitors, but the one I've used on the AS/400 is IBM iDoctor:


It has ( or had ) both free and pay portions.  That same page has a link
other debugging tools at the bottom.

    Keep in mind that there are at least three areas where problems can
arise:  an individual application, Tomcat, the JVM.  Add to that multiple
users on the AS/400, so the problem could be caused or exacerbated by other
unrelated programs, pool allocations, etc.

    In my own case, the classic JVM was running asynchronous garbage
collections that didn't finish before another was requested.  Inadequate
memory and thread contention eventually caused the app ( WebSphere server
and associated web apps ) to freeze with long delays ( sometimes hours ) 
before the gc runs completed.  This was even after various termination 

    The problem was eventually "resolved" by "found" additional memory
allocated to the subsystem.  I was not happy that expensive AS/400 memory
was dedicated to WebSphere when many other applications and users were on
the machine, but the company "gurus" were AIX guys who didn't understand how
the AS/400 works.

    Even so, I think my solution eventually would have been queueing up
(Continue reading)