tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Recovery from OutOfMemoryError?
Date Tue, 31 Jul 2007 19:15:22 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Craig,

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGr4pK9CaO5/Lv0PARAt0kAJwL8lOl5sJCxcMxcgxB4xrWObWiwACfceQn
yBcBzdFnAjafIoBa7Pqo3vY=
=pydn
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message