JIRA applications crash due to OutOfMemoryError PermGen space error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

JIRA applications crash. Errors in the logs appear as:

java.lang.OutOfMemoryError: PermGen space

Causes

The error message java.lang.OutOfMemoryError: PermGen space means Java's fixed block for loading class files has been exceeded. Permanent Generation Memory, unlike Java heap space, is the memory allocation for the classes themselves as opposed to the objects created. There are 3 possible causes for this:

  1. The most common is that the addition of more plugins contributes to more consumption of PermGen space. The error occurs when enough classes are invoked. If this happens, the resolution below applies.
  2. There is also a known bug with JIRA 4.3.1 that can cause this error to occur on Windows Systems. Upgrading to the most recent JIRA application release will resolve that bug - please see Upgrading JIRA applications for information on how to upgrade.
  3. It could also happen if you try and run multiple Atlassian applications in a single Tomcat container. See:

    Do not deploy multiple Atlassian applications in a single Tomcat container

    Deploying multiple Atlassian applications in a single Tomcat container is not supported. We do not test this configuration and upgrading any of the applications (even for point releases) is likely to break it. There are also a number of known issues with this configuration (see this FAQfor more information).

    We also strongly recommend not deploying multiple Atlassian applications to a single Tomcat container for a number of practical reasons. Firstly, you must shut down Tomcat to upgrade any application and secondly, if one application crashes, the other applications running in that Tomcat container will be inaccessible.

    Finally, we recommend not deploying any other applications to the same Tomcat container that runs JIRA, especially if these other applications have large memory requirements or require additional libraries in Tomcat's lib subdirectory.

Resolution

 

To avoid this in the future, follow these steps:

Linux

Expand to see Linux instructions
  1. Make sure $JAVA_HOME is set correctly as in Installing Java. This is important, or the setting won't work. See Increasing Permanent Generation Memory Does Not Work.
  2. Edit <jira-install>/bin/setenv.sh and modify the JIRA_MAX_PERM_SIZE value to be larger. It's recommended to increase by 128mb blocks, testing each increase. Setting a value too high can be just as problematic as one that is too low.

  3. Restart your JIRA applications.

Windows Service

Expand to see Windows Service instructions
  1. Identify the name of the service that JIRA applications are installed as in Windows ( Control Panel > Administrative Tools > Services ):

    (info) In the above example, the SERVICENAME is: JIRA120312230938
  2. Open the command window from Start > Run > type in 'cmd' > press 'Enter'
  3. cd to the bin subdirectory of your JIRA application installation directory (or the bin subdirectory of your Tomcat installation directory if your are running the JIRA WAR distribution).
    For Example:

    cd C:\Program Files\Atlassian\JIRA\bin
  4. For JIRA 5.1 or below run:

    tomcat6w //ES//%SERVICENAME%
    

    For JIRA 5.2 or above run:

    tomcat7w //ES//%SERVICENAME%

     

    (info) In the above example, it would be tomcat6w //ES//JIRA120312230938

  5. Click on the Java tab to see the list of current start-up options:
  6. Scroll down in the "Java Options" pane and modify the -XX:MaxPermSize value to be larger. It's recommended to increase by 128mb blocks, testing each increase. Setting a value too high can be just as problematic as one that is too low.
  7. Restart your JIRA applications.

Windows (starting from .bat file)

Click here to expand...
  1. Make sure $JAVA_HOME is set correctly as in Installing Java. This is important, or the setting won't work. See Increasing Permanent Generation Memory Does Not Work.
  2. Edit <jira-install>/bin/setenv.bat and modify the JIRA_MAX_PERM_SIZE value to be larger. It's recommended to increase by 128mb blocks, testing each increase. Setting a value too high can be just as problematic as one that is too low.

  3. Restart your JIRA applications.

If this above does not resolve the problem, please see Increasing Permanent Generation Memory Does Not Work or raise a support issue on support.atlassian.com.

Last modified on Mar 30, 2016

Was this helpful?

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