I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar
When I open up IDEA, I still see the maximum memory to be 711m.
jps -v
shows my VMOptions has been loaded but it's replaced by the following options.
29388 **-Xmx2048m** -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar -Xms128m **-Xmx800m** -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseCompressedOops -Didea.paths.selector=IdeaIC12 -Dsun.java2d.noddraw=true -Didea.max.intellisense.filesize=2500 -Didea.dynamic.classpath=false -Didea.jars.nocopy=false -Dsun.java2d.d3d=false -Dapple.awt.fullscreencapturealldisplays=false -Dapple.laf.useScreenMenuBar=true -Djava.endorsed.dirs= -Dswing.bufferPerWindow=false -Didea.fatal.error.notification=enabled -Didea.cycle.buffer.size=1024 -Didea.popup.weight=heavy -Didea.xdebug.key=-Xdebug -Dapple.awt.graphics.UseQuartz=true -Dsun.java2d.pmoffscreen=false -Didea.no.launcher=false -DCVS_PASSFILE=~/.cvspass -Didea.use.default.antialiasing.in.editor=false -Dcom.apple.mrj.application.live-resize=false -Didea.smooth.progress=false
29392 Jps -Dapplication.home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -Xms8m
Where does -Xmx800
come from? I need to remove it.
~/Library/Preferences/IdeaIC14/idea.vmoptions
to idea64.vmoptions
before it would recognize the change, i.e., -Xmx2048m
.
Current version: Help
| Change Memory Settings
:
https://i.stack.imgur.com/3mr53.png
Since IntelliJ IDEA 15.0.4 you can also use: Help
| Edit Custom VM Options...
:
This will automatically create a copy of the .vmoptions
file in the config folder and open a dialog to edit it.
Older versions:
IntelliJ IDEA 12 is a signed application, therefore changing options in Info.plist
is no longer recommended, as the signature will not match and you will get issues depending on your system security settings (app will either not run, or firewall will complain on every start, or the app will not be able to use the system keystore to save passwords).
As a result of addressing IDEA-94050 a new way to supply JVM options was introduced in IDEA 12:
Now it can take VM options from ~/Library/Preferences/
For example, to use -Xmx2048m option you should copy the original .vmoptions
file from /Applications/IntelliJ IDEA.app/bin/idea.vmoptions
to ~/Library/Preferences/IntelliJIdea12/idea.vmoptions
, then modify the -Xmx
setting.
The final file should look like:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
Copying the original file is important, as options are not added, they are replaced.
This way your custom options will be preserved between updates and application files will remain unmodified making signature checker happy.
Community Edition: ~/Library/Preferences/IdeaIC12/idea.vmoptions
file is used instead.
[Updated Aug 2021 since the JetBrains UI has changed]
Helpful trick I thought I'd share on this old thread.
You can see how much memory is being used and adjust things accordingly using the Memory Indicator
Right click in the bottom most taskbar area and select the Memory Indicator
item
https://i.stack.imgur.com/Rx4Sa.png
It shows up in the lower right of the window.
https://i.stack.imgur.com/3kuTy.png
View
▶ Status Bar
enabled too.
View
> Appearance
> Status bar widgets
> Memory indicator
For IDEA 13 and OS X 10.9 Mavericks, the correct paths are:
Original: /Applications/IntelliJ IDEA 13.app/Contents/bin/idea.vmoptions
Copy to: ~/Library/Preferences/IntelliJIdea13/idea.vmoptions
Here is a link to the latest documentation as of today http://www.jetbrains.com/idea/webhelp/increasing-memory-heap.html
The memory heap available to IntelliJ IDEA may be changed by editing the corresponding VM options. Depending on the platform, these files are:....
. - TLDR for you?
go to that path "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\bin\idea.exe.vmoptions" and change size to -Xmx512m
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
hope its will work
As for the intellij2018 version I am using the following configuration for better performance
-server
-Xms1024m
-Xmx4096m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:-TraceClassUnloading
-XX:+TieredCompilation
-XX:SoftRefLRUPolicyMSPerMB=100
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
More recent versions of IntelliJ (certainly WebStorm and PhpStorm) have made this change even easier by adding a Help >> Change Memory Settings
menu item that opens a dialog where the memory limit can be set.
https://i.stack.imgur.com/GwLOS.png
OSX 10.9, if you dont bother about signed application you might just change
/Applications/IntelliJ\ IDEA\ 12\ CE.app/bin/idea.vmoptions
On my machine this only works in bin/idea.vmoptions
, adding the setting in ~/Library/Preferences/IntelliJIdea12/idea.vmoptions
causes the IDEA to hang during startup.
idea.vmoptions
in the Preferences
doesn't add options, it replaces them. Therefore you need to copy the original file from the bin
directory and then modify it.
It looks like IDEA solves this for you (like everything else). When loading a large project and letting it thrash, it will open a dialog to up the memory settings. Entering 2048 for Xmx and clicking "Shutdown", then restarting IDEA makes IDEA start up with more memory. This seems to work well for Mac OS, though it never seems to persist for me on Windows (not sure about IDEA 12).
Some addition to the top answer here https://stackoverflow.com/posts/13581526/revisions
Change memory as you wish in .vmoptions Enable memory view as told here https://stackoverflow.com/a/39563251/5515861
And you'll have something like this in the bottom right
https://i.stack.imgur.com/BgGjA.png
I use Mac and Idea 14.1.7. Found idea.vmoptions file here: /Applications/IntelliJ IDEA 14.app/Contents/bin
I edited the config file from the editor and on the next reboot IntelliJ would not open even after updating to the newest version. After opening IntelliJ manually using /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
in terminal
the output gave me additional insight on where the .vmoptions
copy is stored.
➜ ~ /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
2022-04-21 13:01:55.189 idea[1288:14841] allVms required 1.8*,1.8+
2022-04-21 13:01:55.192 idea[1288:14845] Current Directory: /Users/richardmiles
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: IDEA_VM_OPTIONS = (null)
2022-04-21 13:01:55.192 idea[1288:14845] fullFileName is: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] fullFileName exists: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: /Applications/IntelliJ IDEA.app.vmoptions
2022-04-21 13:01:55.195 idea[1288:14845] parseVMOptions: /Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions
2022-04-21 13:01:55.195 idea[1288:14845] parseVMOptions: platform=17 user=1 file=/Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions
Invalid maximum heap size: -Xmx2048m -Drun.processes.with.pty=true
Invalid maximum heap size: -Xmx2048m -Drun.processes.with.pty=true
2022-04-21 13:01:55.266 idea[1288:14845] JNI_CreateJavaVM (/Applications/IntelliJ IDEA.app/Contents/jbr) failed: -6
Note when you work with the path remember to quote properly like so!
vim "/Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions"
Success story sharing
.app
bundle will cause its code signature to break and/or need redoing after every update.$ cp -i /Applications/IntelliJ\ IDEA\ 12.app/bin/idea.vmoptions ~/Library/Preferences/IntelliJIdea12/
. This matches the latest IDEA configuration docs at jetbrains.com/idea/webhelp/increasing-memory-heap.html as mentioned by michael-m.cp /Applications/IntelliJ\ IDEA\ 13.app/bin/idea.vmoptions ~/Library/Preferences/IntelliJIdea13/idea.properties
and thenvi ~/Library/Preferences/IntelliJIdea13/idea.properties