tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Notification strategy for OutOfMemoryError
Date Thu, 12 Dec 2013 14:42:53 GMT
Christopher Schultz wrote:
> 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.

I love the Pratchett reference, but seriously, I believe that in this case at least there

is less chance for the pipe (or the 10-line script/program that runs on it) to go down, 
than for any of the proposed alternative solutions to misfire.
And if it goes down, then Tomcat and the JVM are quite likely to go down alongside it. 
What better notification could one hope for ?
(Except if Nagios goes down of course.)

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

View raw message