Author: eevans
Date: Wed Aug 31 23:57:37 2011
New Revision: 1163873

URL: http://svn.apache.org/viewvc?rev=1163873&view=rev
Log:
set -XX:HeapDumpPath based on env

Patch by satish babu krishnamoorthy and eevans for CASSANDRA-3056

Modified:
    cassandra/branches/cassandra-0.8/conf/cassandra-env.sh

Modified: cassandra/branches/cassandra-0.8/conf/cassandra-env.sh
URL: 
http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/conf/cassandra-env.sh?rev=1163873&r1=1163872&r2=1163873&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/conf/cassandra-env.sh (original)
+++ cassandra/branches/cassandra-0.8/conf/cassandra-env.sh Wed Aug 31 23:57:37 
2011
@@ -117,7 +117,12 @@ JVM_OPTS="$JVM_OPTS -XX:ThreadPriorityPo
 JVM_OPTS="$JVM_OPTS -Xms${MAX_HEAP_SIZE}"
 JVM_OPTS="$JVM_OPTS -Xmx${MAX_HEAP_SIZE}"
 JVM_OPTS="$JVM_OPTS -Xmn${HEAP_NEWSIZE}"
-JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError" 
+JVM_OPTS="$JVM_OPTS -XX:+HeapDumpOnOutOfMemoryError"
+
+# set jvm HeapDumpPath with CASSANDRA_HEAPDUMP_DIR
+if [ "x$CASSANDRA_HEAPDUMP_DIR" != "x" ]; then
+    JVM_OPTS="$JVM_OPTS 
-XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date +%s`-pid$$.hprof"
+fi
 
 if [ "`uname`" = "Linux" ] ; then
     # reduce the per-thread stack size to minimize the impact of Thrift


Reply via email to