tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Curwen" <>
Subject RE: Tomcat 5.0.28 running Windows 2003 Server CPU to 100%
Date Mon, 03 Jan 2005 19:05:25 GMT
Every so often in our development environment, we'll have a page that goes
off in an infinite loop.  No problem, we'll just stop the browser, and fix
the page and click refresh.  But meanwhile, that first page is still
spinning away, gobbling up CPU.  
I once saw code on tomcat-user that allowed me to see what each thread was
doing. It's at the very bottom of this post:
I must have found the 'second part' from somewhere else, probably
tomcat-user as well! It's a filter that renames the thread to be the JSP
page that the thread is processing:
public void doFilter(ServletRequest servletRequest, ServletResponse
servletResponse, FilterChain filterChain) throws IOException,
ServletException {
 Thread t= Thread.currentThread();
 String oldName = t.getName();
 HttpServletRequest request = (HttpServletRequest) servletRequest;
 try {
  t.setName(oldName + " - " + request.getRequestURI());
  filterChain.doFilter(servletRequest, servletResponse);
 } finally {
combining those two, and you'll get what page is currently processing on
what thread.  If you see the same page for more than .... (the time varies,
but let's say 10 seconds)...  then perhaps that page is 'dead' and is
consuming your CPU.

Mike Curwen                                                   
204.885.7733 ext 227

-----Original Message-----
From: David Bilodeau [] 
Sent: Monday, January 03, 2005 12:13 PM
Subject: Tomcat 5.0.28 running Windows 2003 Server CPU to 100%

Can anyone point me to a thread discussing the following configuration or
something similar, where the discussion relates to the CPU running up to
Windows 2003 Server Standard Edition running IIS 6.0
Tomcat 5.0.28 installed and running (as a service)
SQL Server 2000 SP3 connected to Tomcat (and IIS), but running from another
Our symptom is that after a few days the server CPU usage hits 100%, with
Tomcat consuming most of it.  Stopping and restarting each Tomcat virtual
site, or stopping & restarting the Apache service does not resolve the
issue.  Only a box reboot will.
I need some guidance as to where to suggest to the developers they should
look, presuming this is caused by the code.  I am the system admin of the
environment and so do not develop the code myself, but I am seeing this
symptom and now need to ask the developers to examine their code to find a
root cause.
I bet someone, somewhere, has run across this on a thread on this forum and
can point me to it?  I've been searching some but have not found much yet
that is recent.
David Bilodeau
Enterprise Marketing & Sales Automation
Verizon Data Services, Inc.
919 Hidden Ridge, HQM03C76
Irving, TX 75038

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message