Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 19507 invoked from network); 14 Jan 2010 17:50:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jan 2010 17:50:07 -0000 Received: (qmail 32447 invoked by uid 500); 14 Jan 2010 17:50:03 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 32367 invoked by uid 500); 14 Jan 2010 17:50:03 -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 32356 invoked by uid 99); 14 Jan 2010 17:50:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 17:50:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of pid@pidster.com does not designate 216.239.58.184 as permitted sender) Received: from [216.239.58.184] (HELO gv-out-0910.google.com) (216.239.58.184) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jan 2010 17:49:54 +0000 Received: by gv-out-0910.google.com with SMTP id o2so48003gve.39 for ; Thu, 14 Jan 2010 09:49:31 -0800 (PST) Received: by 10.103.84.27 with SMTP id m27mr496911mul.19.1263491370498; Thu, 14 Jan 2010 09:49:30 -0800 (PST) Received: from phoenix.config (94-193-98-41.zone7.bethere.co.uk [94.193.98.41]) by mx.google.com with ESMTPS id 23sm2936085mun.11.2010.01.14.09.49.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 09:49:29 -0800 (PST) Message-ID: <4B4F5927.6060407@pidster.com> Date: Thu, 14 Jan 2010 17:49:27 +0000 From: Pid Reply-To: pid@pidster.com Organization: Pidster Inc User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Re: Tomcat memory settings References: <4B4E34E9.5000408@christopherschultz.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 14/01/2010 16:48, Leo Donahue - PLANDEVX wrote: > Chris, > > Thank you for the feedback. I followed Chuck's advice and set the initial and maximum memory pool using the tomcat6w.exe I have both values set to 512MB. > > Windows Server 2003 Standard SP2 32-bit > Tomcat 6.0.20 > The Java Virtual Machine: C:\Program Files\Java\jdk1.6.0_14\jre\bin\server\jvm.dll > > Looking at the log files, the OOME appears in the logs after long periods of time. Yesterday the message did not appear in the logs until 1:50 AM. > > When Tomcat starts, it is consuming around 87MB of memory and by tomorrow it will grow to around 118MB and somewhere in between there will be a OOME message in the logs. The webapp still works though. > > I hope I can answer the following but I'll admit to you now, I'm not 100% sure I know what I'm doing. Hopefully you will keep the laughter to a minimum as a courtesy? > > I realize that my issue is now probably not related so much to Tomcat but probably the design of the webapp. > >>> Do you keep a lot of information in users' sessions? > I don't know, I'm only keeping one string value which is what the user enters into the query text field. The session timeout is set to 5 minutes. If the string value is short, probably not then. >>> How about in the application context? > I'm not using any init params, if that is what you mean. Sort of. >>> Does your webapp cache a lot of information? > I don't know. OK. >>> Do you use a database connection pool? If so, which one? What is the configuration? > No. I am using a vendor API that makes a connection to their datasource. The user enters a value in the JSF page, the action event is tied to a method that looks up the value in the datasource, if the value was found then page navigation ocurrs and displays results, if the value was not found a message is displayed on the JSF page indicating the value was not found, using the messages tag. A resource leak is when, for example, a database connection is opened but not properly closed. Each time it's opened it's using a bit of memory that isn't returned, because the connection is not closed. It can be hard, but not impossible, to track down the source of this type of problem. >>> Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? > > For each request, if the value is found in the datasource, up to 40 other beans are instantiated and compared to the result of the request. There is also one image that is returned in the process. You can view it here: http://planning.maricopa.gov/plannetquickinfo > > You can use parcel: 211-52-011A as an example search. Where does the image come from and how is it handled? Sometimes image generation can be a problem. Have you had to write any code to make the app work? p > -----Original Message----- > From: Christopher Schultz [mailto:chris@christopherschultz.net] > Sent: Wednesday, January 13, 2010 2:03 PM > To: Tomcat Users List > Subject: Re: Tomcat memory settings > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Leo, > > On 1/11/2010 2:29 PM, Leo Donahue - PLANDEVX wrote: >> org.apache.catalina.core.StandardWrapperValve invoke >> SEVERE: Servlet.service() for servlet "servlet name" threw exception >> java.lang.OutOfMemoryError: Java heap space > > To add to what others have said, getting an OOME can mean one of two things: > > 1. Your webapp simply needs more memory than you are allocating 2. You have a resource leak > > Most often, #2 is the culprit. > > Under what conditions are you getting the OOME? Lots of users after a short period of uptime, or all by yourself on your development environment after a long period of time? > > Do you keep a lot of information in users' sessions? How about in the application context? Does your webapp cache a lot of information? Do you use a database connection pool? If so, which one? What is the configuration? > > Does your webapp do anything that you expect to require very heavy memory consumption (image manipulation, in-memory representations of large datasets, etc.)? If so, you may simply need more memory to properly run your webapp. > > Finally, with a 32-bit JVM (you didn't say which you were using), you'll top-out around 2GiB for your heap no matter how much physical RAM you have. If you need more than 2GiB of heap, you'll need to go with a 64-bit environment. > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAktONOkACgkQ9CaO5/Lv0PAEMACfaS7G/FPgvCkEG1j4tS7mQkrC > PkgAn3CYEh4D8eEa4FJdlLAIp7VmOIWZ > =/cyT > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org