7

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?

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
Zaur Guliyev
  • 4,254
  • 7
  • 28
  • 44
  • The bottom right corner numbers show heap space allocated for IntelliJ Idea itself. You're configuring heap space for java compiler and maven runner. Are you trying to allocate more space for Idea itself? – Andrew Logvinov Jul 14 '12 at 10:50
  • Mm?! actually I'm trying to run a project but it explodes with java heap space exception.. any suggestion? – Zaur Guliyev Jul 14 '12 at 14:44
  • Bottom right corner is of no interest for you then. When exactly do you get OOM error? Also, is it a maven project? – Andrew Logvinov Jul 14 '12 at 15:43

3 Answers3

18

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.

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
Zaur Guliyev
  • 4,254
  • 7
  • 28
  • 44
6

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.

om39a
  • 1,406
  • 4
  • 20
  • 39
2

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.

Community
  • 1
  • 1
Georg
  • 987
  • 8
  • 16