Skip to content

Instantly share code, notes, and snippets.

@P7h
Last active March 22, 2024 20:18
Show Gist options
  • Save P7h/4388881 to your computer and use it in GitHub Desktop.
Save P7h/4388881 to your computer and use it in GitHub Desktop.
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
-XX:SurvivorRatio=8
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=65
-XX:+CMSScavengeBeforeRemark
-XX:+UseCMSInitiatingOccupancyOnly
-XX:ReservedCodeCacheSize=64m
-XX:-TraceClassUnloading
-ea
-Dsun.io.useCanonCaches=false
@maxio89
Copy link

maxio89 commented Jan 26, 2015

Why have you two GC settings?
XX:+UseParNewGC
and also:
-XX:+UseConcMarkSweepGC

@mmizutani
Copy link

As explained in the official documentations for UNIX and Windows (http://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html and http://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html), not only -XX:PermSize and -XX:MaxNewSize but also some other options listed above were deprecated in JDK 8:
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing

@spoage
Copy link

spoage commented May 2, 2015

@maxio89 the former GC setting sets the young heap GC, the latter sets the old heap GC.

@edwardbeckett
Copy link

I'm using these settings and running very well..

@bro0k
Copy link

bro0k commented Sep 16, 2015

thanks

@r4lly99
Copy link

r4lly99 commented Apr 10, 2017

thanks

@tucq88
Copy link

tucq88 commented Apr 17, 2017

Does this work with phpstorm ?

@ivanstnsk
Copy link

works well, thnx :)

@cuteapoot
Copy link

Can you direct me to something that explains what all of these options mean? I keep seeing these options around, but I don't know which ones really apply to my machine or situation.

@P7h
Copy link
Author

P7h commented Jul 20, 2017

@bobojo, this section of documentation has more details for all the options for:

@m-horejsi
Copy link

How actual is this settings? For example in default vmoptions in Intellij IDEA 2017.2.2 is ReservedCodeCacheSize=240m.
I found this and it's updated to IntelliJ IDEA 2017.2 - let's try it 🙂

@inthegarage
Copy link

Intellij 2017.3 will moan about the code cache size, it should be around:
-XX:ReservedCodeCacheSize=256m

or remove the setting altogether.

@aridastidar
Copy link

aridastidar commented Mar 19, 2019

-XX:ReservedCodeCacheSize=64m threw a warning on MacOS HighSierra. Considering increasing to 240m or more.

@reloxx13
Copy link

reloxx13 commented Aug 2, 2019

Pay attention, alot of those options are deprecated and will lead in not starting the application.

Unix Debian with Phpstorm from snap

I had to do this:

Remove

-XX:+UseParNewGC
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
 
Replace
-XX:-TraceClassUnloading -Xlog:class+unload=off

This is my current file for PHPStorm:
~/.PhpStorm2019.2/config/phpstorm64.vmoptions

-server
-Xms1g
-Xmx4g
-XX:NewSize=512m
-XX:MaxNewSize=1g
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
-XX:SurvivorRatio=8
-XX:+UseCodeCacheFlushing
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=65
-XX:+CMSScavengeBeforeRemark
-XX:+UseCMSInitiatingOccupancyOnly
-XX:ReservedCodeCacheSize=256m
-Xlog:class+unload=off
-ea
-Dsun.io.useCanonCaches=false

@jueti
Copy link

jueti commented Aug 28, 2019

thanks reloxx13
it works on Pycharm 2019.2.1 windows

@armarti
Copy link

armarti commented Oct 28, 2019

reloxx's config is good. also add editor.zero.latency.typing=true in idea.properties (Help > Edit Custom Properties).

@iuriimattos
Copy link

iuriimattos commented Nov 16, 2019

Thanks reloxx13

This is my current file for PHPStorm (PhpStorm2019.1) (Windows):

-server
-Xss256k
-Xms1536m
-Xmx1536m
-Xmn512m

-XX:MetaspaceSize=350m
-XX:MaxMetaspaceSize=350m
-XX:SurvivorRatio=8
-XX:CMSFullGCsBeforeCompaction=0
-XX:ReservedCodeCacheSize=240m
-XX:MaxNewSize=1000m
-XX:NewSize=512m
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
-XX:CMSInitiatingOccupancyFraction=65

-XX:+CMSScavengeBeforeRemark
-XX:+CMSPermGenSweepingEnabled
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseCMSCompactAtFullCollection
-XX:+HeapDumpOnOutOfMemoryError
-XX:+UseCodeCacheFlushing
-XX:-TraceClassUnloading
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled

-ea
-Dsun.io.useCanonCaches=false

@alfabravoteam
Copy link

All settings here are still using CMS GC. Anyone trying G1GC options instead?

@indiff
Copy link

indiff commented Jan 20, 2021

-server
-XX:MetaspaceSize=128M
-XX:MaxMetaspaceSize=512M
-XX:+AlwaysPreTouch
-Xms128m
-Xmx512M
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:AutoBoxCacheMax=20000
-ea
-Dsun.io.useCanonCaches=false
-Dsun.awt.keepWorkingSetOnMinimize=true
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djsse.enablesSNIExtension=false
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dfile.encoding=UTF-8
-Duser.name=tshit11

@iuriimattos
Copy link

-server
-XX:MetaspaceSize=128M
-XX:MaxMetaspaceSize=512M
-XX:+AlwaysPreTouch
-Xms128m
-Xmx512M
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:AutoBoxCacheMax=20000
-ea
-Dsun.io.useCanonCaches=false
-Dsun.awt.keepWorkingSetOnMinimize=true
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djsse.enablesSNIExtension=false
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dfile.encoding=UTF-8
-Duser.name=tshit11

Thanks for share! Recommend adding for solve UI issues

-Dhidpi=true
-Dsun.java2d.uiScale.enabled=false
-Dide.ui.scale=1.0

@0x-2a
Copy link

0x-2a commented Jul 7, 2021

@indiff there's a username in those options

@reloxx13
Copy link

reloxx13 commented Sep 5, 2023

A merged from @indiff, @iuriimattos and with JetBrains PhpStorm 2023.2.1RC from a fresh win11 installation default options and some old stuff, I use it in host and client (wsl2) vmoptions.

-Dawt.java2d.opengl=true
-Dawt.lock.fair=true
-Dawt.useSystemAAFontSettings=lcd
-Dfile.encoding=UTF-8
-Dhidpi=true
-Dide.ui.scale=1.0
-Djava.net.preferIPv4Stack=true
-Djbr.catch.SIGABRT=true
-Djdk.attach.allowAttachSelf=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.module.illegalAccess.silent=true
-Djsse.enablesSNIExtension=false
-Dkotlinx.coroutines.debug=off
-Dsun.awt.keepWorkingSetOnMinimize=true
-Dsun.io.useCanonCaches=false
-Dsun.java2d.metal=true
-Dsun.java2d.uiScale.enabled=false
-Dsun.tools.attach.tmp.only=true

-XX:+AlwaysPreTouch
-XX:+CMSClassUnloadingEnabled
-XX:+CMSParallelRemarkEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:+CMSScavengeBeforeRemark
-XX:+HeapDumpOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
-XX:+HeapDumpOnOutOfMemoryError
-XX:+IgnoreUnrecognizedVMOptions
-XX:+TieredCompilation
-XX:+UseCMSCompactAtFullCollection
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:-OmitStackTraceInFastThrow
-XX:-TraceClassUnloading
-XX:AutoBoxCacheMax=20000
-XX:CICompilerCount=2
-XX:CMSFullGCsBeforeCompaction=0
-XX:CMSInitiatingOccupancyFraction=65
-XX:CompileCommand=exclude,com/intellij/openapi/vfs/impl/FilePartNodeRoot,trieDescend
-XX:ConcGCThreads=4
-XX:MaxMetaspaceSize=512m
-XX:MaxNewSize=1g
-XX:MaxTenuringThreshold=1
-XX:MetaspaceSize=512m
-XX:NewRatio=1
-XX:NewSize=512m
-XX:ParallelGCThreads=4
-XX:ReservedCodeCacheSize=512m
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:SurvivorRatio=8

-Xms1g
-Xmx4g

-ea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment