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


##########
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:
   @smiklosovic, in my experience it was often important to see and analyze the 
first occurrence of the issue, so you know the time and can think of what has 
changed in the process and led to OOM, while reoccurrence often happens 
'automatically'.
   It is a heuristic anyway. I suggested this property just based on my gut 
feeling. I felt it would be beneficial to have a very first heap dump in series.
   
   It can be removed and awk can be eliminated. I suggested an option. If it 
does not look right, I will drop it.
   
   Agree about last/first.



-- 
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