tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Recovery from OutOfMemoryError?
Date Tue, 31 Jul 2007 19:15:22 GMT
Hash: SHA1


Craig Berry wrote:
> Fixing the bug would be cool, but the "bug" is actually just too many
> users contending for the same heap space, so that's going to be tough.

Too many users logged-in, or too many simultaneous connections? If the
latter, you can simply limit the number of simultaneous (active)
connections using the <Connector> attributes in server.xml.

If the former, you have many options (from easiest to most difficult):

1. Increase the heap size (you probably already did that).
2. Shorten the session timeout to destroy sessions more quickly.
3. Buy more memory.
4. Cluster your applications among multiple servers.
5. Lighten the amount of information you store in the session to
   reclaim memory.

> I'd thought of the log watcher, but that seems a rather blunt
> instrument; I was thinking there might be some kind of Tomcat (or JVM)
> intrinsic mechanism for this.

Not really. There's no global "exception listener" or anything.
Exceptions are generally handled by the thread that is executing at the
time. A thread that suffers an OOME is pretty much hosed, anyway, so
counting on it to do any kind of recovery is difficult.

- -chris
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


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

View raw message