Java applications like JIRA and Confluence run in a "Java virtual machine" (JVM), instead of directly within an operating system. When started, the Java virtual machine is allocated a certain amount of memory, which it makes available to applications like JIRA. By default, Java virtual machines are allocated 64Mb of memory, no matter how many gigabytes of memory your server may actually have available. 64Mb is inadequate for medium to large JIRA installations, and so this needs to be increased.
On this page:
단계 1: 진단
Determine type of error message
Look in the
atlassian-confluence.log to see which type of OutOfMemory Error you're receiving. There are three common messages:
This document discusses increasing memory to address PermGen and Heap space errors. Follow the links above to assess root causes for each issue. For GC Overhead, refer to Confluence Crashes Due to 'java.lang.OutOfMemoryError GC overhead limit exceeded'.
Determine Confluence's usage patterns
In JIRA, go to
Administration » System » System Info, and look at the memory graph during times of peak usage:
This server has been allocated a maximum of 650Mb and a minimum of 256m. You can see the minimum displayed here; if you're trying to see whether your settings are being picked up, this is where to look.
Determine available system memory
Setting the -Xmx above the available amount on the server runs the risk of OutOfMemoryErrors due to lack of physical memory. If that occurs the system will use swap space, which greatly decreases performance.
The default values supplied with Confluence stand-alone are sufficient for most installations. Please refer to How To Fix Out Of Memory Errors By Increasing Available Memory and How To Fix Out Of Memory Errors By Increasing Available Memory for a discussion.
단계 2: 가능한 메모리 늘리기
We aren't really able to give a concrete recommendation for the amount of memory to allocate, because that will depend greatly on your server setup, the size of your user base, and their behaviour. You will need to find a value that works for you, ie no noticeable GC pauses, and no OutOfMemory errors.
For reference, the 3 most common parameters used to change the memory (heap) allocation are:
- Xms - the minimum size of the heap
- Xmx - the maximum size of the heap
- -XX:MaxPermSize - the maximum size of PermGen
If you do decide to increase the memory settings, there are a few general guidelines to follow.
- Increase Xmx in small increments (eg 512mb at a time), until you no longer experience the OutOfMemory error. This is because increasing the heap beyond the capabilities of your server to adequately Garbage Collect can cause other problems (eg performance/freezing)
If your error is java.lang.OutOfMemoryError: PermGen space, increase the -XX:MaxPermSize parameter in 256mb increments until the error stops occurring.
- If your error does not reference PermGen, there is no need to increase it. In a simplistic explanation, PermGen is used to store classes, and is generally quite static in size. More info here.
- Consider setting Xms and Xmx to the same value, as this can decrease the time GC takes to occur, as it will not attempt to resize the heap down on each collection.
See our Garbage Collection (GC) Tuning Guide for more detailed information.
Windows (starting from .bat file)
There are two ways to configure system properties if you How To Fix Out Of Memory Errors By Increasing Available Memory - either via command line or in the Windows Registry
Setting Properties for Windows Services via Command Line
Setting Properties for Windows Services via the Windows Registry
In some versions of Windows, there is no option to add Java variables to the service. In these cases, you must add the properties by viewing the option list in the registry.
단계 3: 세팅 확인하기
To verify what settings are in place, check Viewing System Information. You should see a section called "Java Runtime Arguments".
Look for Xmx (maximum) and Xms (minimum) settings.
Alternatively, on Linux, run
ps -aux | grep java to see the environment parameters.