lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Boogie Shafer <>
Subject Re: Recovering from Out of Mem
Date Tue, 14 Oct 2014 13:47:47 GMT

a really simple approach is to have the OOM generate an email


1) create a simple script (call it and drop it in your tomcat bin dir

echo `date` | mail -s "Java Error: OutOfMemory - $HOSTNAME"

2) configure your java options (in or similar) to trigger heap dump and the email
script when OOM occurs

# config error behaviors
CATALINA_OPTS="$CATALINA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$TOMCAT_DIR/temp/tomcat-dump.hprof
-XX:OnError=$TOMCAT_DIR/bin/ -XX:OnOutOfMemoryError=$TOMCAT_DIR/bin/

From: Mark Miller <>
Sent: Tuesday, October 14, 2014 06:30
Subject: Re: Recovering from Out of Mem

Best is to pass the Java cmd line option that kills the process on OOM and setup a supervisor
on the process to restart it.  You need a somewhat recent release for this to work properly

- Mark

> On Oct 14, 2014, at 9:06 AM, Salman Akram <>
> I know there are some suggestions to avoid OOM issue e.g. setting
> appropriate Max Heap size etc. However, what's the best way to recover from
> it as it goes into non-responding state? We are using Tomcat on back end.
> The scenario is that once we face OOM issue it keeps on taking queries
> (doesn't give any error) but they just time out. So even though we have a
> fail over system implemented but we don't have a way to distinguish if
> these are real time out queries OR due to OOM.
> --
> Regards,
> Salman Akram
View raw message