tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Notification strategy for OutOfMemoryError
Date Thu, 12 Dec 2013 13:43:50 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 12/12/13, 2:42 AM, André Warnier wrote:
> The original issue of the OP was to be notified ASAP when an OOM
> occurs. And he indicated that an OOM resulted in a message in the
> logs. So, "something" is already catching the OOM exception, to
> write this line in the logs.

Right, but he wants to be notified. Most notification strategies are
flawed at best.

> On the other hand, there is ample literature available that seems
> to indicate that any method for trying to recover from (or even do 
> something worthwhile after) an OOM is ultimately flawed and
> unreliable.

Yes and no. If the OOME was transient (e.g. a single thread ran-away
and filled-up the heap with thread-specific objects), then the heap
can recover then the thread dies (with OOME) and the JVM is likely to
continue without further related errors. On the other hand, you can of
course fill up the heap with objects that will *not* be collected when
the thread is killed, then you're done and bad things will happen like
the GC getting so angry and confused it can't do its job even if the
heap does recover.

> Whilst I am in awe of the various solutions proposed so far (and
> of their developers), would it, in this case, not be simpler to
> pipe the log through a simple filter which catches the OOM log
> message and warns the OP accordingly ?

That works, but you need to make sure that pipe stays up and running
all the time. How do you get notified if the pipe goes down? How do
you recover from the pipe going down... do you need to restart Tomcat?
How do you get notified if the notifier for the pipe going down goes
down? It's turtles all the way down.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.15 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSqb2TAAoJEBzwKT+lPKRYG3MQAMtprIzBT3eyiQdfBpMUuZL+
iLLrLI5lNxnSsRJF5wm6NNJKr0/HZQNzVAtDCTcIIxfhD/U0NGh3NPECceJ8N+dx
A/cZezw0HxtuL+HGEDJip35S8/pTYvqHnRVde+1Z99HhyhZvYLvoUJzOKiCDaKN/
i/Jn4xy5swUQVAlvrc7SBd3G5i1XqjZ8cEp0IsJECgLocxXjGbCAKKUeeDf4azo4
xT+IK0obcdFolVYj3JPUtTsgmiQ81id2vMTlq1RElz+3hex7+odkvB3Yuf5Nw017
ua+OQOEAZFDk6ehCZSKWXtP2BWOylc5kwJxjKJSoOV8BE7FXAayV3xmr+EUpbUfa
16ode+ND+9GQlp5+4py8xl0UC66dfvF/Lm93qEoOlPsg006ybwiRlGhKV4nCsoWe
0h9sUwh9Wxki9FTZMcGI9s3KkRNo8yS3OyogGaZSRA77vbBSU8A5QCaiCRGp9MD+
MDtwGTDYbI9f9L0HvCh/f1pkt2KLYc4dFSBSRF5wp4qjtFq30QiKCVogGmrGNxVp
IEi1MbJLdYo4r2yy4O+lZTXYPzidX5oF0B1h6KsOAMbq8wi23azJz9mp5wMEMFhk
akL8fIsn3ktXo7/V232LGzYibq/wNDlzruUr0ayxVsQXKtMn6yFvQHsgRoaCsUbO
7DUcrLxpUN4llKqmacMO
=5NlU
-----END PGP SIGNATURE-----

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


Mime
View raw message