tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: OutOfMemoryError (but not really out of memory?) cause tomcatprocesses to hang
Date Wed, 07 Feb 2007 23:31:03 GMT
> From: Christopher Schultz [] 
> Subject: Re: OutOfMemoryError (but not really out of memory?) 
> cause tomcatprocesses to hang
> Sharon French wrote:
> > Is it possible that the initial OutOfMemory error occurs 
> > when a large garbage collection is taking place and an
> > OutOfMemoryError is thrown before the memory can be reclaimed
> Yes. In fact, this is often when OOMs occur, since the JVM is trying
> hard to avoid the OOM in the first place.

Uhhh - no.  The JVM will not return an OOME until the GC is completely
finished and the request still cannot be satisfied.  Even with
concurrent GC, failing allocation requests are suspended until a full GC
has completed.  The exception to the above is if a request is made that
could never be satisfied; that will be given an OOME immediately.
> After an OOM is thrown, the JVM is basically completely hosed.

Definitely not true.  The JVM is still functional, although the app
(Tomcat, in this case) may not be able to proceed.

> > If so, how do we combat this behavior?
> Fix resource leaks, allocate an appropriate amount of memory, 
> and limit resource use to avoid OOMs in the first place.

Very good advice.  If you can, use a profiler to find out what (and who)
is consuming the heap.  However, the 64m given to the PermGen is rather
small for an app server, given the number of classes that must be
loaded; for that matter, the 256m for the whole heap is pretty tiny
these days.

 - Chuck

MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message