tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bob Riaz" <br...@mum.edu>
Subject RE: [OT] Tomcat causing high CPU load
Date Thu, 08 Nov 2007 17:29:08 GMT
Thanks. StringBuilder seems to be the most popular suggestion! I'm going to implement this
and report on any changes I see in Tomcat's behavior. 
I'm also looking at other possiblities, such as Tomcat's I/O activities causing thrashing
if I/O is excessive. Would anybody know how I could monitor Tomcat's I/O activities? 
Also, is there a way to configure Tomcat so that a connection times out after a certain period
of time?
Thanks to everyone for your attention and help.

Bob 

-----Original Message-----
From: Kev Jackson [mailto:foamdino@gmail.com]
Sent: Wednesday, November 07, 2007 11:14 PM
To: Tomcat Users List
Subject: Re: [OT] Tomcat causing high CPU load


Hi,
 From a programmatic point of view


> Many thanks for all the suggestions. I found a simple tool called StackTrace from http://www.adaptj.com/root/main/tracehowtos#ht0
to help me take thread dumps from Tomcat. I found when the CPU load was high that there was
a thread from the suspect web app running. In contrast, thread dumps taken when CPU load was
normal showed no such threads. The line that the web app thread was running at is a simple
- data += "\n"; - this is in a loop collecting form data from hidden vars created by JavaScript
code. It's been suggested by ny colleagues that the JVM could be running out of memory since
a new String object is created for each +=. The String data ends up being very long anyway.
Any thoughts on this would be appreciated.
> Also, would anyone know how to monitor Tomcat's I/O activities? I understand that thrashing
could be a drain on memory resources.
> Thanks again for everybody's help!

You could replace the data += "\n" code with a StringBuilder (Java6) or 
a StringBuffer - this would reduce the number of intermediate objects 
being created quite significantly

Kev

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message