Knowledge Base/Troubleshooting

Configuring JVM options and platform properties

Serge Baranov
posted this on March 19, 2013, 07:30

JVM Options

VM options are loaded from the IDE_HOME\bin\<product>[bits][.exe].vmoptions file.

The options are defined one per line:

-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
  • 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 (always idea on Mac).
  • -Xmx value limits the maximum heap memory size that the JVM can allocate.

Mac OS X Specifics

Don't edit idea.vmoptions and idea.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.

IntelliJ IDEA Platform Properties

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
 

Comments

User photo
Adolfo Benedetti

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

 

January 25, 2014, 18:37
User photo
Peter Dresslar

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

July 16, 2014, 01:03
User photo
Raul Medina

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

October 2, 2014, 19:43
User photo
Adolfo Benedetti

@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-14...

October 3, 2014, 15:05
User photo
Alejandrodazal

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

January 2, 2015, 18:51
User photo
Andrus Randveer

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.

January 22, 2015, 14:26
User photo
Adolfo Benedetti

@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>

January 22, 2015, 14:46
User photo
Denis Denisov

@Adolfo

<key>JVMVersion</key>

<string>1.6+</string>

 

Work JDK 6/78

January 22, 2015, 14:48
User photo
Edward

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

February 7, 2015, 14:48