Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 89927 invoked from network); 8 Nov 2007 17:27:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Nov 2007 17:27:21 -0000 Received: (qmail 15603 invoked by uid 500); 8 Nov 2007 17:26:58 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 15368 invoked by uid 500); 8 Nov 2007 17:26:57 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 15357 invoked by uid 99); 8 Nov 2007 17:26:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 09:26:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [69.18.50.66] (HELO is1.mum.edu) (69.18.50.66) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2007 17:26:59 +0000 Received: from CSTech4 ([10.10.43.176]) by is1.mum.edu (8.13.3+Sun/8.13.3) with SMTP id lA8HQXRd019685 for ; Thu, 8 Nov 2007 11:26:33 -0600 (CST) From: "Bob Riaz" To: "Tomcat Users List" Subject: RE: [OT] Tomcat causing high CPU load Date: Thu, 8 Nov 2007 11:29:08 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: <47329B12.6040905@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org 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.=20 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?=20 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=20 -----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 +=3D = "\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 +=3D. 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 +=3D "\n" code with a StringBuilder (Java6) = or=20 a StringBuffer - this would reduce the number of intermediate objects=20 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