tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: OutOfMemory Exception initializing page context
Date Tue, 02 Dec 2003 15:59:34 GMT

> Well I have had my -Xmx set to as high as 1gb and I still receive these
> errors.  The site will stay running for at best 1 day without crashing.
> I was just hoping one of these could point me in a direction while I
> work on looking at memory leaks.

Sorry for the levity. Try this:

Turn on verbose GCs, and make sure you're sending stdout to a log file 
(Tomcat does this by default, I think). Empty the stdout log file, 
restart Tomcat and then let it run out of memory.

Take a look at the GC output (they are prettty obvious) and see what's 
happening to memory. I've done this in the past, and I even wrote a 
(long lost) Perl script to parse the log file and generate X-Y 
coordinates that I could plot using Excel. We could plainly see that 
there was a memory leak of some kind because the graph kept going up and up.

It does take a long time to find memory leaks but there are a couple of 
things you can check.

First of all, what JSK are you using?

Check some of the following:
- Are you starting any of your own threads? If so, are they dying when 
the context reloads?
- Are you reloading the context a lot?
- Do any of your container objects like hashtables or whatever keep 
references to things like the ServletContext, etc.?
- Do you regularly remove old objects from users' sessions?
- Are you doing any XSLT?
- Are you using a database connection pool or are you creating new 
connections for each user?
- Do you keep any persistent connections like sockets or anything open?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message