2014-11-01 3:57 GMT+03:00 Campbell, Lance <la...@illinois.edu>:
>
> Tomcat 7.0.56
>
> Java 7.0_72
>
>
>
> I received the below Tomcat error messages in a web application.  Is there a 
> way for me to catch these exceptions so that I can then either execute Java 
> code or trigger a Linux shell script?
>
>
>
> Oct 31, 2014 7:38:25 PM 
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor doRun
>
> SEVERE:
>
> java.lang.OutOfMemoryError: Java heap space
>
>
>
> Oct 31, 2014 7:38:46 PM org.apache.tomcat.util.net.NioEndpoint$Acceptor run
>
> SEVERE:
>
> java.lang.OutOfMemoryError: Java heap space
>
>
>
> Oct 31, 2014 7:38:49 PM org.apache.tomcat.util.net.NioEndpoint$Poller run
>
>
> Thanks,

There is a family of options such as -XX:OnOutOfMemoryError,
-XX:+HeapDumpOnOutOfMemoryError in Oracle Java. The first one is used
to launch an external script in case of OOM.

Doing anything from Java rarely works in case of an OOM error,
especially a "PermGen" OOM. (You have a bit more luck with your "Java
heap space" one).

See
http://markmail.org/message/rr26epg4oap4syus
"Notification strategy for OutOfMemoryError"
thread from about a year ago.

Best regards,
Konstantin Kolinko

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

Reply via email to