Troubleshoot Jira Server performance with GC logs

Still need help?

The Atlassian Community is here for you.

Ask the community

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

The instructions here are for JIRA 7.3 and older only.

We've improved the garbage collection logs starting from JIRA 7.4, and they're now generated automatically, you'll be able to find them in your logs at <installation-directory>/logs.

JIRA Software 7.4.x release notes

Other than that, all the recommended parameters below are no longer supported in Java 9 and upwards, as the Unified JVM Logging has been introduced. So, if your Java version is newer than Java 8, please follow the steps here:

Garbage Collection Log Settings for Jira when using Java Version 11


Garbage Collection

JIRA applications are robust applications that rarely require in-depth garbage collection (GC) tuning. However, on large-scale installations, GC tuning can improve the performance of JIRA applications. Analysis of GC logs can also assist in troubleshooting performance problems with a JIRA application. Starting from JIRA 7.4, GC logs are generated automatically, and you can find them in <installation-directory>/logs.

Diagnosis

Verbose garbage collection will generate log statements that indicate when Java is collecting garbage, how long this process takes, and how much memory has been freed. You can enable verbose garbage collection by adding the below options to the JVM, as in our Setting Properties and Options on Startup documentation.

The Xloggc parameter must use the full path for the location of the GC logs, as in the below examples. We recommend putting them in the $JIRA_HOME/log directory as when generating a Support Zip they will be included. If your directory is different than the default, please use that directory.

The parameter -XX:+PrintGCCause was introduced within Java 1.7.0_45 and will not work if you are using a version of Java prior to that version. Please check the version of Java that is being used by your instance of JIRA prior to using this flag.

Using Linux/Unix (Java up to 8):

-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -Xloggc:<PATH_TO_GC_LOGS>/atlassian-jira-gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M

Using Linux/Unix (Java 9 and later):

-Xlog:gc*:file=<PATH_TO_GC_LOGS>/atlassian-jira-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=20M

Using Windows (Java up to 8):

-Xlog:gc*:file=<PATH_TO_GC_LOGS>\atlassian-jira-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=20M
-XX:+PrintGCDetails

-XX:+PrintGCDateStamps
-XX:+PrintGCTimeStamps
-XX:+PrintGCCause
-Xloggc:<PATH_TO_GC_LOGS>\atlassian-jira-gc-%t.log
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=5
-XX:GCLogFileSize=20M

Using Windows (Java 9 and later):

-Xlog:gc*:file=<PATH_TO_GC_LOGS>\atlassian-jira-gc-%t.log:tags,time,uptime,level:filecount=5,filesize=20M

We advise setting the <PATH_TO_GC_LOGS> the same as Jira's installation directory (catalina_home), eg. /opt/atlassian/jira/logs. This allows the GC logs to be included in Support Zips.

Where to set the parameters

You may follow the Setting properties and options on startup guide to set the parameters. We advise filling the JVM_GC_ARGS or JVM_SUPPORT_RECOMMENDED_ARGS if the first's not present.

Be mindful that some parameters may already be present elsewhere in the setenv.sh/setenv.bat. We advise removing them from elsewhere to avoid duplicates and confusion on later editions fo the file.

Analysis

  1. Once you have added these options and restarted your JIRA applications, the log specified by the -Xloggc parameter will record memory usage information that can be analyzed using tools like GCViewer.
  2. A more complete guide to the practices and principles of GC tuning can be found at Garbage Collection (GC) Tuning Guide.
  3. Java VisualVM can also be installed and used to bind to the process that is running your JIRA applications. This can be used to analyze CPU utilization by GC, along with the heap usage. The visualGC plugin is recommended to be installed as it will provide a visual breakdown of each heap space.
  4. To better understand GC, you can also take a look at third-party blogs, such as Java Garbage Collection Distilled

In addition to GC logging, you can also use heap dumps for analysis. For more information, see Analyze OutofMemory errors in Jira server with Heap Dumps.

Recommendations

It is unwise to provide general recommendations for all situations - there is no substitute for an in-depth assessment using analysis tools. Atlassian recommends engaging the services of an Atlassian Partner for performance analysis of your JIRA applications and the environment it runs in.

Please see our Troubleshoot performance issues in Jira server  documentation for further assistance with diagnosing performance problems.



DescriptionThis page discusses analysis of GC logs that can assist in troubleshooting performance problems with a JIRA application.
Last modified on Aug 4, 2021

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.