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 
-XX:MaxMetaspaceSize

-XX:MaxMetaspaceSize=350m
GC overhead limit
exceeded
Increase heap size via -Xmx parameter.  -Xmx1024m sets heap space to 1024mb. 
 
 
6 out of 33 found this helpful
4 comments

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 https://plumbr.eu/outofmemoryerror/metaspace

4

@Jeff Fritz

Have a look at the documentation here - https://www.jetbrains.com/help/youtrack/standalone/Configure-JVM-Options.html

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.

 

0

I set the heap space to 16GB worked for a couple of weeks, and the issue re-appeared, i have a total of 32gb on manjaro linux.

0

I managed to get my application running by going to "Intellij -> Preference -> Compiler -> Shared Build Process Heap Size" and adjusting the override size to use 16gb also.

I still feel like this is some sort of caching issue though.

0

Please sign in to leave a comment.

Have more questions?

Submit a request