Maven import in Intellij IDEA runs out of memory on a large project
Solution 1
The solution is to set -Xmx1g
(or more) in Maven VM options for importer (yes, it is a separate option!). Go to "Settings/Preferences -> Build Tools -> Maven -> Importing", and find the option there.
Read more on JVM heap size: (Q) What are the Xms
and Xmx
parameters when starting JVMs?.
Solution 2
if you want in idea, this config will be success. "Build process heap size (Mbytes)"
preference->Build,Execution,Deployment->Compiler:Build process heap size (Mbytes)
Related videos on Youtube
![naXa stands with Ukraine](https://i.stack.imgur.com/LVOVA.jpg?s=256&g=1)
naXa stands with Ukraine
#BelarusWithUkraine π€β€οΈπ€ πΊπ¦ I focus mostly on java technologies such as spring-framework, android, hibernate, gradle, etc. Employment history: Exadel, ScienceSoft, self-employed. Feel free to consider all code I provide on Stack Overflow licensed under CC0, I would be happy to receive an "honourable mention" or something, but for the code it's optional.
Updated on June 15, 2020Comments
-
naXa stands with Ukraine about 4 years
Import of Maven project ends with
Exception java.lang.OutOfMemoryError: GC overhead limit exceeded
- I've tried to define an environment variable:
MAVEN_OPTS = -Xmx1g
. - I've tried to add
-Xmx1g
to Maven VM options via Settings -> Build Tools -> Maven -> Runner.
Without success. What else can I do?
- I've tried to define an environment variable:
-
naXa stands with Ukraine over 6 yearsIf increasing memory limit doesn't help, check idea.log (how to find logs?) for errors related to Maven importing.
-
Wangshen Bi about 6 yearspreference->Build,Execution,Deployment->Compiler:Build process heap size (Mbytes)
-
sarthakgupta072 about 5 yearsGo to Preferences (on Mac) instead of Settings. :)
-
R11G over 4 yearsCan -Xmx be set to 16384?
-
naXa stands with Ukraine over 4 years@R11G yes, you can set it to 16384, but note that 16384 bytes are just 16 kilobytes. set it to 16384k if you want 16 megabytes, or 16384m if you want 16 gigabytes.