Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-61415

Java 11 Garbage Collection Logging Settings Are Not Correctly Applied on Confluence Start

XMLWordPrintable

      Issue Summary

      The default garbage collection configuration for Confluence running Java 11 is incorrectly applied resulting in unexpected logging formats.

      Steps to Reproduce

      1. Make a change to setenv.sh with new Java 11 garbage collection logging configuration
      2. Start Confluence
      3. Check Garbage Collection logging

      Expected Results

      The new garbage collection configuration is reflected in the logging.

      Actual Results

      The default garbage collection settings for Java are reflected in the logs

      Cause

      Java 8 and prior used the -Xloggc: syntax for formatting garbage collection log locations. With the introduction of Java 11, the syntax was moved to -Xlog:gc (note the moved colon). In order to maintain some backwards compatibility, the -Xloggc: syntax was remapped to the default Java 11 configuration. This configuration overrides anything else configured with the new syntax.

      Details of this change are briefly mentioned at https://bugs.openjdk.java.net/browse/JDK-8170636

      Workaround

      Confluence Version 7.11.latest and Earlier

      Remove the old Java 8 garbage collection configuration which by default is

      Java 8 Garbage Collection Configuration
      CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
      

      Add the following in place

      Java 11 Garbage Collection Configuration
      CATALINA_OPTS="-Xlog:gc*:file=$LOGBASEABS/logs/gc-%t.log:tags,time,uptime,level:filecount=5,filesize=2M ${CATALINA_OPTS}"
      

      Confluence Version 7.12.0 and Later

      Comment out the old Java 8 garbage collection configuration which by default is

      Java 8 Garbage Collection Configuration
      CATALINA_OPTS="-Xloggc:$LOGBASEABS/logs/gc-`date +%F_%H-%M-%S`.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=2M ${CATALINA_OPTS}"
      

              Unassigned Unassigned
              jponting James Ponting
              Votes:
              10 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated:
                Resolved: