netudima commented on code in PR #4166:
URL: https://github.com/apache/cassandra/pull/4166#discussion_r2153164662


##########
conf/cassandra-env.sh:
##########
@@ -199,6 +199,44 @@ if [ "x$CASSANDRA_HEAPDUMP_DIR" = "x" ]; then
 fi
 JVM_OPTS="$JVM_OPTS -XX:HeapDumpPath=$CASSANDRA_HEAPDUMP_DIR/cassandra-`date 
+%s`-pid$$.hprof"
 
+# Cassandra heap dump files management options:
+# if not set externally, this script assigns defauls:
+#  - enable heap dump files clean up
+#  - keeping 2 newest files
+#  - keeping 1 oldest file to help identify first OOM incident
+if [ "$CASSANDRA_HEAPDUMP_CLEAN" = "" ]; then
+    CASSANDRA_HEAPDUMP_CLEAN=1
+fi
+if [ "$CASSANDRA_HEAPDUMP_KEEP_NEWEST_N_FILES" = "" ]; then
+    CASSANDRA_HEAPDUMP_KEEP_NEWEST_N_FILES=2
+fi
+if [ "$CASSANDRA_HEAPDUMP_KEEP_OLDEST_N_FILES" = "" ]; then
+    CASSANDRA_HEAPDUMP_KEEP_OLDEST_N_FILES=1
+fi
+
+clean_heap_dump_files()

Review Comment:
   if this function is only used by bin/cassandra would it be more 
straightforward to declare it in bin/cassandra itself? It would remove the 
necessity to use non-obvious should_clean_heap_dump_files flag..



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to