Re: java.lang.OutOfMemoryError: Java heap space

2009-10-08 Thread Joe Hansen
Yup, it looks like you have more of your application objects taking up memory than the tickets you were worried about. So True! We are right now designing and developing our next generation of websites and this experience will surely come handy. I will now think twice before I store anything in

RE: java.lang.OutOfMemoryError: Java heap space

2009-10-08 Thread Caldarale, Charles R
From: Joe Hansen [mailto:joe.hansen...@gmail.com] Subject: Re: java.lang.OutOfMemoryError: Java heap space Is the use of SoftReference popular? You'll find it as the underlying mechanism of many cache managers, since it automatically adapts reasonably well to whatever the execution

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joe, On 10/8/2009 12:12 PM, Joe Hansen wrote: I will now think twice before I store anything in the session and will make sure I remove no longer used objects from the HTTP Session. It's always a good goal to limit your session size, but it's not

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, A correction to my code: On 10/8/2009 4:22 PM, Christopher Schultz wrote: public class SoftReferenceFilter implements Filter { This class needs two additional methods: public void init(FilterChain chain) { } public void

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 All, Another correction to the code: On 10/8/2009 4:22 PM, Christopher Schultz wrote: public static class SoftReferenceSessionWrapper implements HttpSession { Remember to implement getValue and putValue to call getAttribute and

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joe, On 10/6/2009 3:44 PM, Joe Hansen wrote: I did not check the CPU usage when the issue happened. I just checked the web application logs and found that first there was an OutOfMemoryError, followed by MySQL errors when

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-07 Thread Joe Hansen
WoW! jmap was a great command to learn Chris! Thank you so much! I generated a histogram of the Objects in the java heap (while things were stable) and here's what I got: Object Histogram: SizeCount Class description --- 149989048

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joe, On 10/7/2009 8:40 PM, Joe Hansen wrote: WoW! jmap was a great command to learn Chris! Thank you so much! Yeah, it's great as a poor-man's memory profiler. On the other hand, I haven't seen a big-time memory profiler offer such a simple view of

RE: java.lang.OutOfMemoryError: Java heap space

2009-10-07 Thread Caldarale, Charles R
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: java.lang.OutOfMemoryError: Java heap space There are even techniques that will allow your session objects to expire when memory gets tight (which is super cool IMO). To put a name on the above technique, read up

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Rainer Jung
On 05.10.2009 22:04, André Warnier wrote: André Warnier wrote: ... and still wants to add something : - a new KeepAlive connection is made from the browser to Apache (httpd). - then a request comes in on that connection, and it happens to be one that gets forwarded to Tomcat. So a mod_jk

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Rainer Jung
On 05.10.2009 18:58, Joe Hansen wrote: Thank you so much for your tips, Rainer! The websites went down yet again. Increasing the java heap size took care of the OutOfMemoryError, but the number of httpd processes keep increasing until the websites crash. I haven't added any new code in the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Rainer Jung
On 05.10.2009 18:58, Joe Hansen wrote: Thank you so much for your tips, Rainer! The websites went down yet again. Increasing the java heap size took care of the OutOfMemoryError, but the number of httpd processes keep increasing until the websites crash. I haven't added any new code in the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Joe Hansen
Rainer, Thanks for looking at those long thread dumps for me!! I am sorry. I did NOT take these dumps at the right time (i.e. when Tomcat was inundated with requests and couldn't cope with the load). After I increased the heap size to 512MB (from 64MB default), I am not getting the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Joe Hansen
Rainer, I spoke to soon! As I suspected, the problem isn't fixed yet and the websites crashed again. This time I took three thread dumps at the time tomcat was down. Here they are: http://pastebin.com/m2a7e1198 I will learn from your previous analysis of the thread dumps and I try to understand

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Joe Hansen
There were 29 httpd processes running when the websites crashed. One thing that was clear from the thread dumps was there were lots of entries for org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner: Starting cleaning of expired tickets from ticket registry at ... Does that

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Rainer Jung
On 06.10.2009 19:44, Joe Hansen wrote: I will only comment the threads for the AJP pool. Everything else seems not relevant: Dump 1: 20 threads connected to Apache, waiting for the next request 3 threads idle in the pool 1 thread waiting for the next connection 0 threads working on requests

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Joe Hansen
Thanks for your feedback, Rainer. The DAO objects/methods that you've mentioned are used for almost every page on our website. So I am not surprised to find them in the thread dumps. However, as you pointed out, the parameters to these methods change depending on the page they are on and if the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread André Warnier
Rainer Jung wrote: On 06.10.2009 21:44, Joe Hansen wrote: ... It seems your application is CPU heavy. Either the data objects handled are to heavy weight (maybe some user having huge Fotoset or Email list) or the request rate is simply to large. Is the CPU saturated during the problems? I

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Joe Hansen
I changed the session-timeout for the CAS webapp to 1 hour and restarted Apache/Tomcat to see if that changes anything. If the issue manifests again, I will surely check the memory and cpu usage using the top command. Rainer, I somewhat doubt that getAllFotosets() is causing the problem. Because

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-06 Thread Peter Crowther
2009/10/6 Joe Hansen joe.hansen...@gmail.com: Andre, you are right. Memory is cheap. However, the machine has 8GB of memory already. I am thinking that it should be sufficient. You might wish to dedicate more of that 8 Gbyte to Java, though. It depends on the performance characteristics of

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread Joe Hansen
Thank you so much for your tips, Rainer! The websites went down yet again. Increasing the java heap size took care of the OutOfMemoryError, but the number of httpd processes keep increasing until the websites crash. I haven't added any new code in the past few months, hence I am surprised why the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread Joe Hansen
Rainer, Here are the KeepAlive values in httpd.conf: KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimout 15 Thanks, Joe What are your KeepAlive* settings ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread André Warnier
Joe Hansen wrote: Rainer, Here are the KeepAlive values in httpd.conf: KeepAlive Off MaxKeepAliveRequests 100 KeepAliveTimout 15 Well, since you have KeepAlive Off, the other 2 do not matter. But as such, it means that each request of each browser is going to create a new connection to the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread Joe Hansen
Thank you for the reply, Andre. I now understand how setting KeepAlive to On would improve the performance of a website (The Apache manual says that a 50% increase in throughput could be expected). So I changed the KeepAlive to On and restarted the server. I however wonder if this will fix the

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread André Warnier
Joe Hansen wrote: Thank you for the reply, Andre. I now understand how setting KeepAlive to On would improve the performance of a website (The Apache manual says that a 50% increase in throughput could be expected). So I changed the KeepAlive to On and restarted the server. Now wait. You

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread André Warnier
André Warnier wrote: ... and still wants to add something : - a new KeepAlive connection is made from the browser to Apache (httpd). - then a request comes in on that connection, and it happens to be one that gets forwarded to Tomcat. So a mod_jk connection is made to Tomcat, Tomcat allocates

RE: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread Caldarale, Charles R
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: java.lang.OutOfMemoryError: Java heap space The bottleneck would be in Tomcat, but it would show up at the httpd level. The bottleneck might also be in something external to Tomcat, such as a database or some external web service

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-05 Thread Joe Hansen
Andre, Thanks for pointing out the high KeepAliveTimeout value in the config file. I have read the docs and have changed it to 5 seconds (which is the default). I am hoping that Rainer could find out from the thread dump where the requests are getting stuck, so that I can put this issue to bed.

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-04 Thread Joe Hansen
Rainer, Thank you so much for your kind reply! I have increased the java heap size to 512MB (-Xms512m -Xmx512m). I am hoping that would fix the issue. I had configured our webserver to use Jasig's Central Authentication System (CAS). Recently I increased the session timeout from 30 minutes to 4

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-04 Thread Joe Hansen
I found the following error message in the Apache logs: [Sat Oct 03 04:10:49 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting Here's a snippet from the httpd.conf, which deals with MaxClients. IfModule prefork.c StartServers 8 MinSpareServers5

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-04 Thread Rainer Jung
On 04.10.2009 22:17, Joe Hansen wrote: I found the following error message in the Apache logs: [Sat Oct 03 04:10:49 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting Here's a snippet from the httpd.conf, which deals with MaxClients. IfModule prefork.c

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-04 Thread Rainer Jung
Hi Joe, On 04.10.2009 21:45, Joe Hansen wrote: Rainer, Thank you so much for your kind reply! I have increased the java heap size to 512MB (-Xms512m -Xmx512m). I am hoping that would fix the issue. I had configured our webserver to use Jasig's Central Authentication System (CAS). Recently I

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-04 Thread André Warnier
Joe Hansen wrote: I found the following error message in the Apache logs: [Sat Oct 03 04:10:49 2009] [error] server reached MaxClients setting, consider raising the MaxClients setting Here's a snippet from the httpd.conf, which deals with MaxClients. IfModule prefork.c StartServers 8

Re: java.lang.OutOfMemoryError: Java heap space

2009-10-03 Thread Rainer Jung
On 03.10.2009 20:07, Joe Hansen wrote: Hey All, I get this error (java.lang.OutOfMemoryError: Java heap space) after my Apache 2.0/Tomcat 5.5/mod_jk installation has been up and running for a few hours. This problem started just since two days. Never had this issue before! I have also

RE: java.lang.OutOfMemoryError: Java heap space

2007-03-20 Thread Caldarale, Charles R
From: Jean-Sebastien Pilon [mailto:[EMAIL PROTECTED] Subject: java.lang.OutOfMemoryError: Java heap space What could be my problem Your application has a memory leak (or you might be running out of PermGen space). where should I look next ? http://tomcat.apache.org/faq/memory.html -

Re: java.lang.OutOfMemoryError: Java heap space

2007-03-20 Thread Filip Hanik - Dev Lists
Add -XX:+HeapDumpOnOutOfMemoryError to your command line options, this will create a .hprof file when you get an OOM error, then simply analyze this file with a little tool called YourKit (www.yourkit.com) excellent profiler Filip Jean-Sebastien Pilon wrote: Hello, I have been