Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA Gradle Sync OutOfMemory

I wonder how to increase heap size of Gradle Daemon process that IntelliJ IDEA uses to Sync project?

Current process uses -Xms256m -Xmx512m

I've already changed gradle-wrapper.properties file to:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
org.gradle.jvmargs=-Xms4g -Xmx4g -XX:MaxPermSize=2048m

My IntelliJ IDEA settings: enter image description here enter image description here

like image 372
Artiom Saidanov Avatar asked Dec 05 '25 18:12

Artiom Saidanov


1 Answers

The file gradle-wrapper.properties is for the wrapper scripts only. The org.gradle.jvmarg option doesn't belong in there.

Rather, put it in a gradle.properties file in the project root directory. See here for more information.

Also be aware that XX:MaxPermSize is not supported since Java 8.

Lastly, you may need to also raise the heap used by IntelliJ itself. Check the current usage by right-clicking on the status bar and select Memory Indicator:

enter image description here

Notice the current and max heap in the bar to the right. If it is close to full, you can change the heap size under Help -> Change Memory Settings:

enter image description here

The memory settings you showed is for the IntelliJ compiler. But as you can see from the Gradle settings you also showed, you delegate the build to Gradle. So this has no effect.

like image 107
Bjørn Vester Avatar answered Dec 08 '25 07:12

Bjørn Vester



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!