Tuning JVM Garbage Collector (Best values for JIRA 6 & 7 large instances)

The following example JVM settings are recommended for most production servers (JIRA works better as standalone installation):

-server -Xms24G -Xmx24G -XX:PermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70

For production replica servers (test environments), use the example settings:

-server -Xms4G -Xmx4G -XX:PermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70

For standalone installations (recommended in JIRA large installations), use the example settings:

-server -Xms32G -Xmx32G -XX:PermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70

The above options have the following effect:

  • -Xms, -Xmx: Places boundaries on the heap size to increase the predictability of garbage collection. The heap size is limited in replica servers so that even Full GCs do not trigger SIP retransmissions. -Xms sets the starting size to prevent pauses caused by heap expansion.
  • -XX:+UseG1GC: Use the Garbage First (G1) Collector.
  • -XX:MaxGCPauseMillis: Sets a target for the maximum GC pause time. This is a soft goal, and the JVM will make its best effort to achieve it.
  • -XX:ParallelGCThreads: Sets the number of threads used during parallel phases of the garbage collectors. The default value varies with the platform on which the JVM is running.
  • -XX:ConcGCThreads: Number of threads concurrent garbage collectors will use. The default value varies with the platform on which the JVM is running.
  • -XX:InitiatingHeapOccupancyPercent: Percentage of the (entire) heap occupancy to start a concurrent GC cycle. GCs that trigger a concurrent GC cycle based on the occupancy of the entire heap and not just one of the generations, including G1, use this option. A value of 0 denotes ‘do constant GC cycles’. The default value is 45.

More info in this tunning GC JIRA Guide

Advertisements

20 thoughts on “Tuning JVM Garbage Collector (Best values for JIRA 6 & 7 large instances)

  1. Hello!

    We can use these configurations independent of our JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY in setenv.sh?

    Thanks!

    Best regards,
    Rodrigo Kondo

    Liked by 1 person

      1. If we don’t remove the params of the size memory (-Xms32G -Xmx32G), does this sets my JVM to 32G?

        Like

      2. What configurations would you recommend for a large JIRA instance?
        Our server has 128GB of memory and 2 deca-core CPU.

        Like

      1. We have 2000 users and 280 projects and 883 customfields. We are using 16GB for JIRA without any downtime and the performance is good. For EazyBI we are using 16GB in a separated child. For JIRA we use these params: e -Xms16G -Xmx16G -XX:+UseG1GC -XX:NewRatio=2 -XX:SurvivorRatio=8 -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=3612m -XX:ReservedCodeCacheSize=512m -XX:InitiatingHeapOccupancyPercent=60 -XX:+UseCodeCacheFlushing -Djira.jelly.on=true

        Hope this solve your doubt

        Like

      1. Today our configuration is JVM_MINIMUM_MEMORY=”8192m” and JVM_MAXIMUM_MEMORY=”12288m” and we were having lots of downtimes and slowness in JIRA.
        Sou yesterday we tunned the garbage collector suggested here (-server -Xms32G -Xmx32G -XX:PermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 -XX:+HeapDumpOnOutOfMemoryError) and we only had to restart JIRA once yesterday… it is a great advance.
        So we’re gonna wait untill have to restart it again to test those configuration you sent us.

        Thanks a lot!

        Like

      2. Hi again!

        In this morning we replied the configurations you gave us but we kept the -Xms32G -Xmx32G and also set the JVM min and max to 32G. And untill now it is working great!

        Do you have a description about those parameters that we just set?

        Thanks!

        Rodrigo Kondo

        Like

      3. We just had to roll back to the first garbage collector tunning (-server -Xms32G -Xmx32G -XX:PermSize=512m -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70) because today we had to restart JIRA 4 times, and after changing the GC tunning the slowness stopped.
        I thing that these settings works better for our environment.

        Like

      4. OK otherwise you can try with the GC CMS (is faster, but has a little stops sometimes). Best regards… each server is different

        Like

  2. All the params are for the tunning of the Garbage Collector (G1GC) with 20 parallel threads, 5 concurrents and when the occupancy of the Heap is about 70% then the collector starts to clean the stack with a max pause in “ms” of 200… I think the trick is the “70%” 🙂

    Like

    1. So do you recommend adding the -XX:PermSize=512m XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70 in those previous settings you sent (-Xms16G -Xmx16G -XX:+UseG1GC -XX:NewRatio=2 -XX:SurvivorRatio=8 -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=3612m -XX:ReservedCodeCacheSize=512m -XX:InitiatingHeapOccupancyPercent=60 -XX:+UseCodeCacheFlushing -Djira.jelly.on=true) ?

      Like

      1. Sorry, no.

        If your JIRA >= v.7 then try these params: Xms16G -Xmx16G -XX:+UseG1GC -XX:NewRatio=2 -XX:SurvivorRatio=8 -XX:MetaspaceSize=1024m -XX:MaxMetaspaceSize=3612m -XX:ReservedCodeCacheSize=512m -XX:InitiatingHeapOccupancyPercent=60 -XX:+UseCodeCacheFlushing -Djira.jelly.on=true

        The others are the usual params for Java apps in Server sites:
        XX:PermSize=512m XX:MaxGCPauseMillis=200 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:InitiatingHeapOccupancyPercent=70

        If your JIRA goes down eventually try to change the SurvivorRatio

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s