netudima commented on code in PR #4166: URL: https://github.com/apache/cassandra/pull/4166#discussion_r2153133574
########## 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 last 2 files +# - keeping 1 oldest file to help identify first OOM incident +if [ "x$CASSANDRA_HEAPDUMP_CLEAN" = "x" ]; then + CASSANDRA_HEAPDUMP_CLEAN=1 +fi +if [ "x$CASSANDRA_HEAPDUMP_KEEP_LAST_N_FILES" = "x" ]; then + CASSANDRA_HEAPDUMP_KEEP_LAST_N_FILES=2 +fi +if [ "x$CASSANDRA_HEAPDUMP_KEEP_FIRST_N_FILES" = "x" ]; then + CASSANDRA_HEAPDUMP_KEEP_FIRST_N_FILES=1 Review Comment: while it is frequently useful to get a first occurrence of an error in log (for example to seen when an issue was first observed) I have not seen in reality a case when in a relatively short period of time multiple different reasons caused OOM to have an necessity to keep the oldest one, so I doubt if it could actually help, IMHO. Also, without an operator intervention this logic will preserve an oldest file forever until somebody removes it. So, if it allows to simplify the logic I would suggest to not have it.. -- 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