43

I just upgraded my IntelliJ to 14.0.3. But there's always an Out Of Memory dialog popped up to ask me to set the memory.

Following is my settings: enter image description here

I thought it's enough. But the dialog shows from time to time, and sometimes, it's not responding that I have to shutdown it.

How should I set this for IntelliJ 14? Any ideas?

Pang
  • 9,564
  • 146
  • 81
  • 122
Sky
  • 7,343
  • 8
  • 31
  • 42

5 Answers5

57

Open Intellij IDE's vmoptions file

For Mac Users

Help | Edit Custom VM Options...

or

Library > Preferences > Idea<YourVersion> > idea.vmoptions

For Window (32bit) Users

C:\Program Files (x86)\JetBrains\IntelliJ IDEA <your_version>\bin\idea.exe.vmoptions

For Window (64bit) Users

C:\Program Files (x86)\JetBrains\IntelliJ IDEA <your_version>\bin\idea64.exe.vmoptions

and setup it's memory as you wish. Below is sample settings for 2GB

-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops

Hopefully this help.

Cataclysm
  • 7,592
  • 21
  • 74
  • 123
  • 7
    I can't startup my IntelliJ if I set -Xmx to 2048M, my computer has 8 GB memory. – Sky Feb 27 '15 at 08:39
  • Here is useful questions for your problem http://stackoverflow.com/questions/17221725/how-to-increase-the-memory-heap-size-on-intellij-idea-12 , http://stackoverflow.com/questions/13578062/how-to-increase-ide-memory-limit-in-intellij-idea-on-mac – Cataclysm Feb 27 '15 at 08:45
  • 1
    under Windows: "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.1\bin\idea64.exe.vmoptions" – Frank N Feb 03 '16 at 13:42
  • 1
    Under Windows it could be either of the followings, depending on which installation (x86, x64) you use: "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.4\bin\idea.exe.vmoptions" "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.4\bin\idea64.exe.vmoptions" – martoncsukas Jun 09 '17 at 13:23
  • `Help | Edit Custom VM Options` works on Windows too. IntelliJ 2018.2 – Zoe Sep 27 '18 at 17:48
10

I have allocated 4 GB to intelliJ 14 on windows 7. My settings in idea64.exe.vmoptions are :

-Xms4608m
-Xmx4608m
-Xmn2g
-Xss128k
-XX:MaxPermSize=1536m
-XX:ParallelGCThreads=20

Sarneet Kaur
  • 2,860
  • 1
  • 14
  • 12
  • 30
    for the hardware grammar police, "4GB" is `4096m` (4 * 1GB = 4 * 1024MB) – ecoe Nov 28 '15 at 15:12
  • Was trying to commit but failed after 20 minutes from out of memory error. Did the above and the commit was processed almost instantly. Thanks! – Brian Jan 05 '16 at 15:09
  • The -Xmx setting also seems to work on Linux (Mint 17.3), and solved the stupid memory popup problem. This was driving me crazy. I even switched which Java IDEA boots from (it's bundled now in Linux) to the latest and greatest JRE and it was still slow. – RyanNerd May 18 '16 at 19:12
  • for WebStorm you want to find the webstorm.vmoptions file located in WebStorm.app/Contents/bin/webstorm.vmoptions – ART GALLERY Jan 12 '17 at 18:51
4

You can set IntelliJ IDEA's memory settings and your application's memory settings in the following places:

IDEA's vmoptions file:

Under Windows it could be either of the followings, depending on which installation (x86, x64) you use:

  • C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.4\bin\idea.exe.vmoptions
  • C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.4\bin\idea64.exe.vmoptions

VM Options in the Run/Debug Configuration:

enter image description here

martoncsukas
  • 2,077
  • 20
  • 23
1

If you still see this popup frequently even with high memory allocated, try:

File > Invalidate Caches / Restart...

hidro
  • 12,333
  • 6
  • 53
  • 53
1

It really depends on the nature of the error. One thing to try is using idea64.exe instead of idea.exe.

If this doesn't help, please contact JetBrains by filing an issue to https://youtrack.jetbrains.com/newissue and attach your log there (Help | Show log).

Peter Gromov
  • 17,615
  • 7
  • 49
  • 35