1, the background

Idea is a frequently used Java IDE. Performance affects the mood of development. He that will do his work well must first sharpen his tools.

2. Optimized parameters

The feeling after optimization is that bad workmen often blame their tools. Why did I choose to suffer silently and not change when I could easily code fluently? It’s really a lot smoother.

The current PC configuration is Windows I5 8-core 16GB

# custom IntelliJ IDEA VM options # heap size, set to the same, avoid automatic capacity increase -xms1536m -XMx1536m # young generation size, Sun recommends setting it to 3/8 of the heap size. -xmn576M # pre-initializes all pages in the heap at JVM startup, which can be quickly used to set a larger initial value of the meta space, -xx :MetaspaceSize=256m -xx :MaxMetaspaceSize=768m # enable G1GC # -xx :+UseG1GC # enable CMS GC -xx :+ CMSPARallelEnabled # The new generation GC before the re-marking of the CMS GC. The bigger in order to reduce the frequency of GC - XX: CMSInitiatingOccupancyFraction = 75 - XX: + UseCMSInitiatingOccupancyOnly # object promotion to old s age, 15 by default. -xx :MaxTenuringThreshold=10 # Compressing common object Pointers -xx :+UseCompressedOops # -server # JIT code cache size, default is 240M -xx :ReservedCodeCacheSize=360M Default is open - XX: every MB + TieredCompilation # pile of soft references to survive in space approximation milliseconds - XX: SoftRefLRUPolicyMSPerMB = 50 # OOM when output heap dump dump file - XX: + HeapDumpOnOutOfMemoryError # prohibited dropped some exception stack trace optimization, prevent information are eating can't find the problem - XX: # - OmitStackTraceInFastThrow disable bytecode verification. IDEA's code is reliable enough, Assertion # Enable assertion -ea-dfile. encoding=UTF-8 -dsun. IO. UseCanonCaches =false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log -XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof - javaagent: D: \ software \ JetBrains \ IntelliJ IDEA 2019.2 \ bin \ JetBrains - agent. The jarCopy the code

3, Cutom VM options and idea.exe.vmoptions

  • Idea.exe. vmoptions are built-in development tools. You are not advised to change the options because they will be overwritten during the upgrade
  • Cutom VM options are user – defined and left to user customization. Stored in the user directory by default. IntelliJIdea2019.2 / config
  • Idea.exe. vmoptions is a global configuration. Cutom VM options overwrites the defined configuration

4. The startup fails after the configuration is modified

The error message is as follows:

MaxJavaStackTraceDepth=-1 is outside the allowed range. The configuration file format is incorrect or contains unrecognized attributes.

Actually the -xx :+UseParNewGC: set the young user to multithreaded collection this property is deprecated.

The JDK for IDEA is JDK11, so this property is not included. It’s consistent with appearances.

Idea JVM tuning, MaxJavaStackTraceDepth=-1 is outside the allowed range

Still using the default JVM parameters of IDEA? Then it’s time to optimize your idea and experience the feeling of flying.