Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save LetItRock/9cc14ccdf49722ba3bdbd4a78e7baa11 to your computer and use it in GitHub Desktop.
Save LetItRock/9cc14ccdf49722ba3bdbd4a78e7baa11 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
@LetItRock
Copy link
Author

-Xms - initial memory allocation pool
-Xmx - maximum memory allocation pool
-XX:NewSize - parameter control the new generation’s minimum size
-XX:MaxNewSize - parameter control the new generation’s maximum size
-XX:PermSize - parametr control permanent generation minimum size (permanent generation is used to hold reflective data of the VM itself such as class objects and method objects)
-XX:MaxPermSize - parametr control permanent generation maximum size
-XX:+UseParNewGC - parallel young generation collector
-XX:+UseConcMarkSweepGC - http://stackoverflow.com/questions/2101518/difference-between-xxuseparallelgc-and-xxuseparnewgc
-XX:ParallelGCThreads=4 - number of GC threads to use for parallel GC
-XX:MaxTenuringThreshold=1 - http://stackoverflow.com/questions/13543468/maxtenuringthreshold-how-exactly-it-works
-XX:SurvivorRatio=8 - should be used when you want to explicitly size survivor spaces to manipulate object aging with the concurrent garbage collector
-XX:+UseCodeCacheFlushing - https://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-4-heap-tuning/
-XX:+AggressiveOpts - turn on point performance compiler optimizations that are expected to be default in upcoming releases.
-XX:+CMSClassUnloadingEnabled - collect PermGen space in the CMS concurrent cycle
-XX:+CMSIncrementalMode - enables incremental mode
-XX:+CMSIncrementalPacing - the percentage (0 to 100) of time between minor collections that the CMS collector is allowed to run
-XX:+CMSParallelRemarkEnabled - https://www.jclarity.com/2013/12/11/poorly-chosen-java-hotspot-garbage-collection-flags-and-how-to-fix-them/
-XX:CMSInitiatingOccupancyFraction=65 - https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms.html
-XX:+CMSScavengeBeforeRemark - options forces young collection as soon as CMS is ready for remark pause, even if Eden is not full yet
-XX:+UseCMSInitiatingOccupancyOnly - https://blog.codecentric.de/en/2013/10/useful-jvm-flags-part-7-cms-collector/
-XX:ReservedCodeCacheSize=64m - is an option for the (just-in-time) compiler of the Java Hotspot VM. Basically it sets the maximum size for the compiler's code cache
-XX:-TraceClassUnloading - to see what classes are loaded/un-loaded in real-time
-ea
-Dsun.io.useCanonCaches=false - canonicalization cache

//
http://www.oracle.com/technetwork/articles/java/vmoptions-jsp-140102.html
https://blogs.oracle.com/poonam/entry/about_g1_garbage_collector_permanent
https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/cms.html
https://www.jclarity.com/2013/12/11/poorly-chosen-java-hotspot-garbage-collection-flags-and-how-to-fix-them/
http://blog.ragozin.info/2011/06/understanding-gc-pauses-in-jvm-hotspots_02.html
http://blog.ragozin.info/2013/11/hotspot-jvm-garbage-collection-options.html
http://stackoverflow.com/questions/7513185/what-are-reservedcodecachesize-and-initialcodecachesize
http://mark.koli.ch/understanding-javas-perm-gen-maxpermsize-heap-space-etc

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