Forgot to mention that we are using Sun's JVM 1.4.2_06 on Linux (Debian 3.0r2, Kernel 2.6.4, i686 with NPTL threads enabled) using a Xeon system.

At 11:18 AM 12/10/2004, Brad Neuberg wrote:
Hi everyone. Over at the company I work for, Rojo, we've been having a variety of Out of Memory (OOM) issues. We have found some fixes that might be useful for other developers; at the same time we are still struggling with some classes of OOM issues as well.

We've had several different OOM errors that are unrelated:

1) If you have a large scale web application with many JSP files, or an application that will generate a large amount of reflective objects (if it is using Hibernate for example), the default Permanent Generation and Max Permanent Generation settings on the JVM are not sufficient. By default these are 64 megabytes if you use the "-server" option for the JVM. In our own app, however, when all JSPs are compiled and loaded into memory, including the tremendous number of classes we have, our Permanent Generation stands around 150 megabytes! Setting -XX:+PermSize and -XX:+MaxPermSize to around 200 megabytes solved this particular issue; if you are getting out of memory issues with your application and you already have a large heap size that is not filling up then this might help you as well. We also now precompile our JSPs which helps a bit as well.
2) We were caching a large amount of search objects in each user's session objects; some of this data wasn't being let go fast enough, causing OOM issues. While we probably need to refactor this portion of our system using WeakReferences or something similar, we found a temporary workaround by setting session-timeout to 1 minute in tomcat/conf/web.xml; this will invalidate the user's session every minute. We don't force our users to sign back in because we store cookies with user information sufficient to transparently sign the user back in that get sent with each request. This is obviously a temporary hack and we need to solve our underlying data caching issues.


Our final OOM issue is the following. We still get OOM issues with the above fixes in. I have set up VisualGC to get an understanding of how memory is partitioned in the heap. I have a screenshot of our VisualGC heap usage right after the OOM; I have put it on my webserver at:

http://codinginparadise.org/images/outofmemory.png

If you look at that graph, you will see that our Permanent, Old, and Eden spaces have more than enough memory. Are we running out of file or thread descriptors? Is it something outside of the JVM?

Brad


Brad Neuberg, [EMAIL PROTECTED] Senior Software Engineer, Rojo Networks Weblog: http://www.codinginparadise.org

=====================================================================

Check out Rojo, an RSS and Atom news aggregator that I work on. Visit http://rojo.com for more info. Feel free to ask me for an invite!

Rojo is Hiring! If you're interested in RSS, Weblogs, Social Networking, Java, Open Source, etc... then come work with us at Rojo. If you recommend someone and we hire them you'll get a free iPod! See http://www.rojonetworks.com/JobsAtRojo.html.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Brad Neuberg, [EMAIL PROTECTED] Senior Software Engineer, Rojo Networks Weblog: http://www.codinginparadise.org

=====================================================================

Check out Rojo, an RSS and Atom news aggregator that I work on. Visit http://rojo.com for more info. Feel free to ask me for an invite!

Rojo is Hiring! If you're interested in RSS, Weblogs, Social Networking, Java, Open Source, etc... then come work with us at Rojo. If you recommend someone and we hire them you'll get a free iPod! See http://www.rojonetworks.com/JobsAtRojo.html.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to