increase IntelliJ java heap size

22,832

Solution 1

Adding -Xms512m -Xmx1024m settings to Maven runner configurations (not the one in Preferences but the one I created for my project) solved java heap space error for me.

Solution 2

Try adding MAVEN_OPTS as -Xms512 -Xmx1024m to windows environment variables. Right click my computer-> advanced-> environment variables and try running the maven build and see if it works.

Solution 3

The real answer to the question's headline on Mac is here: How to increase IDE memory limit in IntelliJ IDEA on Mac?

Quoting CrazyCoder:

Now it can take VM options from ~/Library/Preferences/<appFolder>/idea.vmoptions and system properties from ~/Library/Preferences/<appFolder>/idea.properties.

Share:
22,832
Zaur Guliyev
Author by

Zaur Guliyev

Backend software engineer @trivago.

Updated on July 21, 2022

Comments

  • Zaur Guliyev
    Zaur Guliyev almost 2 years

    after a lot of research I could not get a result. I'm new to IntelliJ IDEA, I use 11.1.2 version. I work with 3 modules (3 eclipse projects) and in each of them I setted Preferences -> Compiler -> Java Compiler with the following values:

    Maximum heap size (MB): 512

    Additional command line parameters:

    -target 1.6 -XX:MaxPermSize=512M -Xms256m -Xmx512m -XX:PermSize=512m

    And also configured Maven runner's VM Options as the following:

    -XX:PermSize=1024m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 -Duser.language=en

    with skip tests checked...

    I also changed Applications -> IntelliJ IDEA 12 -> Contents -> Info.plist:

          <key>VMOptions</key>
          <string>-ea -Xverify:none -Xbootclasspath/a:../lib/boot.jar</string>
    
          <key>VMOptions.i386</key>
          <string>-Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m</string>
    
          <key>VMOptions.x86_64</key>
          <string>-Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m -XX:+UseCompressedOops</string>
    
          <key>WorkingDirectory</key>
    

    But after doing these changes IntelliJ shows me 200-250 MB of heap space allocated on the bottom right... What is wrong?