There may be cases where you would want to take thread dumps when there is a java.lang.OutOfMemoryError: Java heap space, as it will help with correlation with heap dumps. To do so, you can overwrite the “-XX:OnOutOfMemoryError” parameter in the extraJavaOpts in the system.yaml. This parameter is already present by default but will be overwritten when used with extraJavaOpts like below.
shared: ## Java 17 distribution to use #javaHome: "JFROG_HOME/artifactory/app/third-party/java" ## Extra Java options to pass to the JVM. These values add to or override the defaults. extraJavaOpts: "-Xms512m -Xmx4g -XX:OnOutOfMemoryError=\"/opt/jfrog/artifactory/app/third-party/java/bin/jcmd %p Thread.print > /tmp/ThreadDump.txt ; kill -9 %p\""