Tuesday, February 27, 2024

How to enable GC logs in Java8

Step-by-step guide

  • Add the following lines to the integrator.sh file under $JVM_MEM_OPTS \ as below.

$JVM_MEM_OPTS \
   -XX:+HeapDumpOnOutOfMemoryError \
   -XX:HeapDumpPath="$CARBON_HOME/repository/logs/heap-dump.hprof" \
   -XX:+PrintGC \
   -XX:+PrintGCDetails \
   -XX:+PrintGCDateStamps \
   -Xloggc:"$PRODUCT_HOME/logs/gc.log" \
$JAVA_OPTS \

  • It will print the GC logs into gc.log file inside <product_location>/logs/ directory.

No comments:

Post a Comment