Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Hi, The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. I could not tell you whether that is a good or bad statistic for a 2 man development Tomcat that uses database pooling to SQL Server, Struts and a Content Management System. I don't consider what we are doing to be overly complicated. However, when we get to lauch to 300 people, I am a little nervous that we will hit OutOfMemory within seconds. Our Tomcat 5 loads itself by default at around 30MB. When the first hit to the web application goes in it leaps by 2-3 MB. Then each subsequent request seems to cost about 50-100K for just moving around. There are not many session objects being stored. The memory increases all the time and very rarely drops. Last night when we left it stood at 70MB and coming in this morning it was still 70MB. Would anyone be kind enough to provide some tips on how to analyse this problem or what it might be even with the view to a 300 user burdon being placed on Tomcat. Is Tomcat even supposed to be able to handle 300 users? Are there any good sources of information on the web relating to tuning Tomcat or its performance - I have looked around but could not find anything definitive. Many thanks for your time, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
-Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Yes I would like to profile my applicationbut do you have any tips on how to do this or where to start? Thanks -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 12:49 To: 'Tomcat Users List' Subject: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight In my opnion, is better instead of increasing memory of tomcat JVM try to profile your application. I´m sure if tomcat complain about memory, your servlets have something wrong. -- De: Francois JEANMOUGIN[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 7:31 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight -Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Howdy, JProfiler is one option, there are many others. I use OptimizeIt on a regular basis. How to profile? Umm, that's a bit of a black art. Basically, start the profiler following its documentation on how to tie it into your tomcat process. You will see where CPU time is spent and where memory is allocated. Look for unnecessary allocations (why do I still have 20 instance of foo.bar around, they should all be gone by now...) and overly heavy methods (how come foo.bar.getX is taking 5 seconds, it's a simple read operation). Profiling and memory tuning go hand in hand. You will go through several iterations of playing with the Java VM Options before you settle on the optimal one. Can tomcat handle 300 users? Sure, depending on your hardware and your webapps. This is why you stress-test your app with a tool like JMeter that can simulate 300 users hitting your site. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. Umm, no. 64MB is the default heap which includes the VM and your applications. At that size, VM stack/symbol table overhead is far less than 64MB, and so the total process resident size would not be 158MB unless other wacky things were going on. But anyways, my point is that whatever you specify in -Xmx is total for the JVM's heap, which includes its own objects as well as your applications, not just your applications. And another basic note on JVM memory usage: it will never go down overnight. The JVM allocates memory as needed (by default, this can be changed using parameters like -Xms), and will not release that memory back to the operating system, ever. It'll release the memory back into its own heap, but it will stay tied to the JVM process. JVM process memory is monotonically increasing in the strict mathematical sense of the term. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]