Skip to content
Browse files

Forcibly kill JVM on OOM.

  • Loading branch information...
1 parent bba040b commit 6e6c4b5a9f6004fd9aa34c42d697966ff0607f37 Robert Newson committed Dec 8, 2010
Showing with 8 additions and 1 deletion.
  1. +5 −0 src/main/assembly/dist.xml
  2. +2 −0 src/main/bin/kill_ppid
  3. +1 −1 src/main/bin/run
View
5 src/main/assembly/dist.xml
@@ -21,6 +21,11 @@
<outputDirectory>/bin</outputDirectory>
</file>
<file>
+ <source>${project.basedir}/src/main/bin/kill_ppid</source>
+ <fileMode>755</fileMode>
+ <outputDirectory>/bin</outputDirectory>
+ </file>
+ <file>
<source>${project.basedir}/src/main/conf/couchdb-lucene.ini</source>
<fileMode>644</fileMode>
<outputDirectory>/conf</outputDirectory>
View
2 src/main/bin/kill_ppid
@@ -0,0 +1,2 @@
+#!/bin/sh
+kill -9 "$PPID"
View
2 src/main/bin/run
@@ -3,7 +3,7 @@
[ -z $CL_BASEDIR ] && CL_BASEDIR=`dirname "$0"`
cd $CL_BASEDIR/..
-JAVA_OPTS="-server -Xmx1g"
+JAVA_OPTS="-server -Xmx1g -XX:OnOutOfMemoryError=bin/kill_ppid"
CLASS=com.github.rnewson.couchdb.lucene.Main
CLASSPATH="conf"

0 comments on commit 6e6c4b5

Please sign in to comment.
Something went wrong with that request. Please try again.