OutOfMemoryError:Metaspace errors with Java 8+ in Jira server
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.
Resolution
- Remove the -XX:MaxMetaspaceSize parameter entirely, since Java 8 automatically increases the MetaSpace area as needed.
- Alternatively, increase the XX:MaxMetaspaceSize value.
Sources:
- Java Platform, Standard Edition HotSpot Virtual Machine Garbage Collection Tuning Guide
- Java - Advanced Garbage Collection Options
Last modified on May 9, 2024
Powered by Confluence and Scroll Viewport.