Configuring JVM options and platform properties

JVM Options

VM options are loaded from the IDE_HOME\bin\<product>[bits][.exe].vmoptions file or from the copy of this file created by the Help | Edit Custom VM Options main menu action.

The recommended way of changing the JVM options is via the Help | Edit Custom VM Options action. This action will create a copy of the .vmoptions file and open an editor where you can change them. If you can't start IDE to access this menu, edit the file manually as described below.

  • when an IDE is not installed by Toolbox App:

The .vmoptions file is created and located in the config directory.

  • when an IDE is installed by Toolbox App:

The .vmoptions file is managed by Toolbox App. You can find its location from:

Toolbox App -> the locknut icon -> Settings -> Configuration -> Java Virtual Machine options "Edit..."

Please note that custom .vmoptions file created using 'Edit Custom VM Options' action has the priority over the original file in the bin directory.

The options are defined one per line:

-server
-Xms128m
-Xmx512m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:MaxJavaStackTraceDepth=-1
  • If you are running under 64-bit JVM (verify in Help | About), options should be edited in the file with 64 suffix in its name (idea64.exe.vmoptions, or idea64.vmoptions on Linux, but always idea.vmoptions on Mac).
  • product would be one of following: idea, phpstorm, webstorm, pycharm, rubymine, appcode.
  • -Xmx value limits the maximum heap memory size that the JVM can allocate.

In order for the customizations to survive updates, copy the file to IDE configuration directory, then modify the copy instead of the original.

Mac OS X Specifics

Don't edit .vmoptions and .properties files directly, it will violate the application signature, always make a copy of the files under IDE configuration directory and edit the copy instead. See this answer for details. The original file is located in /Applications/<Product>.app/Contents/bin folder (/Applications/<Product>.app/bin for older IDE versions).

IntelliJ IDEA Platform Properties

The recommended way of changing the platform properties in the recent product versions is from the Help | Edit Custom Properties menu. This action will create a copy of the .properties file in the IDE config directory and open an editor where you can change them. If you can't start IDE to access this menu, edit the file manually as described below.

You can change properties in the IDE_HOME\bin\idea.properties file for all the products, some popular properties that you may want to adjust:

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall system memory requirements are
# if code assistance is enabled. Remove this property or set to very large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=2500

 

#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb)
# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled
#---------------------------------------------------------------------
idea.cycle.buffer.size=1024

In order for the customizations to survive updates, copy the file to IDE configuration directory, then modify the copy instead of the original.

 
130 out of 266 found this helpful
22 comments

I'm using this on my Intellij13 (idea.vmoptions:

-ea
-server
-Xms1g
-Xmx1g
-Xss16m
-XX:PermSize=256m
-XX:MaxPermSize=256m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseConcMarkSweepGC
-XX:LargePageSizeInBytes=256m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
-XX:ParallelGCThreads=8
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+HeapDumpOnOutOfMemoryError
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+UseCompressedStrings
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions

 

1
Avatar
Permanently deleted user

Of course you will need to run your text editor as administrator if editing files in Windows 7-Program Files.

0
Avatar
Permanently deleted user

Hi Adolfo! Those settings are for what? make IntelliJ faster or what is the purpose? Thanks!

0

@Raul, the behavioural and performance settings are specifically combined to fit my machine and the type of projects I'm working with. Some of those flags are deprecated or changed with java 8... you can read more about the flags in the documentation: 

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html

0
Avatar
Permanently deleted user

@Adolfo What properties recommended for idea14, I tested these and substantially reduced startup time

0
Avatar
Permanently deleted user

Perhaps it would be better to link from MacOSX section to here https://www.jetbrains.com/idea/help/increasing-memory-heap.html

Or just copy the idea.vmoptions things over from there to here.

0

@Alejandrodazal I use more or less the same settings, but like I mentioned to Raul, if you are using java 8 you need to control your flags(PermGen to Metaspace), 

-XX:MetaspaceSize=XXXm

-XX:MaxMetaspaceSize=XXXm

more info: http://java.dzone.com/articles/java-8-permgen-metaspace

on OSX you need to change the value of your <key>JVMVersion</key> to use java 8 with <string>1.8*</string>

0

@Adolfo

<key>JVMVersion</key>

<string>1.6+</string>

 

Work JDK 6/78

0
Avatar
Permanently deleted user

@Adolfo ~ Thanks for the MetaSpace reminder ... forgot all about permgen disappearing.

0
Avatar
Permanently deleted user

This is great information. Has anyone updated @Adolfo's original options/settings for the latest versions of the IDEs?

0
Avatar
Permanently deleted user

what is the optimum setting for file and why is it not easier to set? If we are to play with it over the life of the product.

0
Avatar
Permanently deleted user

Link to "IDE Configuration Directory" is broken.

0
Avatar
Permanently deleted user

I just updated to 2016.1
Program FIles(x86)->JetBrains->IntelliJ IDEA 2016.1 -> bin -> idea64.exe.vmoptions is right there where it's supposed to be.

Program still won't start with the dialog

"Error launching IDEA. Cannot find VM options file"

0
Avatar
Permanently deleted user

@Todd I had the same problem and it was because I was trying to use the shortcut for the previous version. I just pinned the new shortcut that was created and now it works. Not sure if this is the same problem you are having.

0
Avatar
Permanently deleted user

The setting causing this to fail to start up in 2016.1 is this one:

-XX:+UseCompressedStrings

Remove it and it all works fine...

0
Avatar
Permanently deleted user

hi,under IntelliJ IDEA 2016.1.1 and jdk1.8.0_77 and wondows7 MetaspaceSize isn't work. why? help me,thanks a lot.

-server
-Xss256k
-Xms1536m
-Xmx1536m
-Xmn512m
-XX:PermSize=350m
-XX:MaxPermSize=350m
-XX:MetaspaceSize=350m
-XX:MaxMetaspaceSize=350m
-XX:+UseParNewGC
-XX:SurvivorRatio=8
-XX:+UseConcMarkSweepGC
-XX:+CMSScavengeBeforeRemark
-XX:+CMSPermGenSweepingEnabled
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseCMSCompactAtFullCollection
-XX:CMSFullGCsBeforeCompaction=0
-XX:CMSInitiatingOccupancyFraction=70
-XX:ReservedCodeCacheSize=240m
-XX:+HeapDumpOnOutOfMemoryError

0

How do you know that it doesn't work? What do you expect to happen?

0
Avatar
Permanently deleted user

why display metaspace size 1.078G, i set MaxMetaspaceSize=350m,why?thanks.

0

You can check idea.log (https://intellij-support.jetbrains.com/hc/articles/207241085) to see if this options was applied from your custom .vmoptions file. If it was, the rest is up to the VM. In case the VM doesn't respect this option, please submit a bug to Oracle.

0
Avatar
Permanently deleted user

Thank you for your reply.

It seem like that the options was applied,but it doesn't work.

 

0

For Mac OS X, **DO NOT** make your own copy of idea64.vmoptions. Simply use the Help-->Edit Custom VM Options. It will make the copy for you.

I had problems when I created idea64.vmoptions myself (per this article) and then used the Help menu to edit it. Everything saves OK, but my new VM Options were still not being used. I deleted the new idea64.vmoptions file and started again from scratch, and it seems to finally be working.  I can finally use IntelliJ in "real time" again :-)

0
Avatar
Permanently deleted user

I wrote a guide on github that explains many of these flags and what they do. Anyone visiting this page for performance guidance please take a look and contribute if you have some knowledge! 

https://github.com/FoxxMD/intellij-jvm-options-explained

0

Article is closed for comments.

Have more questions?

Submit a request