Skip to content
This repository
Browse code

Forcibly kill JVM on OOM.

  • Loading branch information...
commit 95858f79e5111cc740a362fd8d7b27d0a0c7b6f5 1 parent 9efa799
authored December 08, 2010
5  src/main/assembly/dist.xml
@@ -21,6 +21,11 @@
21 21
       <outputDirectory>/bin</outputDirectory>
22 22
     </file>
23 23
     <file>
  24
+      <source>${project.basedir}/src/main/bin/kill_ppid</source>
  25
+      <fileMode>755</fileMode>
  26
+      <outputDirectory>/bin</outputDirectory>
  27
+    </file>
  28
+    <file>
24 29
       <source>${project.basedir}/src/main/conf/couchdb-lucene.ini</source>
25 30
       <fileMode>644</fileMode>
26 31
       <outputDirectory>/conf</outputDirectory>
2  src/main/bin/kill_ppid
... ...
@@ -0,0 +1,2 @@
  1
+#!/bin/sh
  2
+kill -9 "$PPID"
2  src/main/bin/run
@@ -3,7 +3,7 @@
3 3
 [ -z $CL_BASEDIR ] && CL_BASEDIR=`dirname "$0"`
4 4
 cd $CL_BASEDIR/..
5 5
 
6  
-JAVA_OPTS="-server -Xmx1g"
  6
+JAVA_OPTS="-server -Xmx1g -XX:OnOutOfMemoryError=bin/kill_ppid"
7 7
 CLASS=com.github.rnewson.couchdb.lucene.Main
8 8
 
9 9
 CLASSPATH="conf"

0 notes on commit 95858f7

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