How to fix the java.lang.OutOfMemoryError exception

The java.lang.OutOfMemoryError exception can be fixed by increasing the memory allocated for Java. To fix the error, identify the particular type of the java.lang.OutOfMemoryError you've got.

Depending on the exception reason, you should run YouTrack with the corresponding start parameter to solve the problem. Please refer to the table below:

Reason Fix and Java Parameter Sample
Java heap space  Increase heap size via -Xmx Java start parameter.  -Xmx1g sets allocated heap size to 1Gb
Metaspace  Increase MaxMetaspaceSize parameter via 

GC overhead limit
Increase heap size via -Xmx parameter.  -Xmx1024m sets heap space to 1024mb. 
Comment actions Permalink

What about java.lang.OutOfMemoryError: Metaspace ?

"Starting from Java 8, the memory model in Java was significantly changed. A new memory area called Metaspace was introduced and Permgen was removed." - per

Comment actions Permalink

@Jeff Fritz

Have a look at the documentation here -

Initially our installation had set MaxMetaSpaceSize to 250m, but we kept getting

java.lang.OutOfMemoryError: Metaspace

As a workaround I have tried setting MaxMetaSpaceSize to 350m. I'll report back here if this doesn't work.



Please sign in to leave a comment.

Have more questions?

Submit a request