OutOfMemoryError:Metaspace errors with Java 8+ in Jira server
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Summary
Symptoms
JIRA is unable to start up.
JIRA throws the below error during use, and may cause unexpected problems.
The following appears in the catalina.out:
2014-09-25 14:56:32,907 localhost-startStop-1 ERROR [atlassian.jira.startup.LauncherContextListener] Unable to start JIRA due to Java Error.
java.lang.OutOfMemoryError: Metaspace
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2957)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210)
Environment
JIRA was configured with the -XX:MaxMetaspaceSize JVM parameter (as per Setting properties and options on startup).
Diagnosis
If the above error messages are present in the logs this KB applies.
Cause
JAVA 8 is no longer using PermGen to store class metadata, as it was replaced by MetaSpace, which uses the native heap.
Setting a limit to this value (with -XX:MaxMetaspaceSize) may cause this error to happen.
Solution
Resolution
Remove the -XX:MaxMetaspaceSize parameter entirely, since Java 8 automatically increases the MetaSpace area as needed.
Alternatively, increase the XX:MaxMetaspaceSize value.
Sources:
Was this helpful?