tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: How do you catch these exceptions
Date Sat, 01 Nov 2014 12:59:29 GMT
2014-11-01 3:57 GMT+03:00 Campbell, Lance <lance@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message