How to Enable Garbage Collection (GC) Logging
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Purpose
Garbage collection logs are useful when trying to isolate issues within Java-based applications as they will pinpoint blocked, hung or stuck threads that may be causing downstream effects in the application. It is always useful to collect at least 10 minutes of garbage collection logs, but analysis accuracy is often increased by the amount of recent log data to review.
Linux
Add the following parameters into your Confluence System Properties, in the <CONFLUENCE_INSTALL>/bin/setenv.sh
file (be sure to enter the path for your <CONFLUENCE_INSTALL>
directory):
Windows
Batch File
If you start Confluence using start-confluence.bat
, add the below code to setenv.bat
:
Service
If you start Windows as a Service, add the below to the service by following these steps (be sure to enter the path for your <CONFLUENCE_INSTALL>
directory)
Differences between JDK 8 and JDK11/17
For further information about the different GC configuration between JDK8 and JDK11/17, please check our KB Unrecognized JVM GC options when using JDK 11/17