The default configuration
The default configuration is low, and it’s easy to get stuck when opening larger projects, so it’s best to expand the memory.
VM configuration for IntelliJ IDEA
IntelliJ IDEA2020 version already has Chinese Chinese plug-in, not familiar with English can install, configure VM menu see “help” -> “edit custom VM options”.
Configure directly.
# custom IntelliJ IDEA VM options
# # # # # # # # # # # # # # # # # # the JVM pattern # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# IDEA JVMS start in Server mode (default ParNew for new generation)-server # # # # # # # # # # # # # # # # # # memory allocation # # # # # # # # # # # # # # # # # # # # # # # # # # # # # heap initial occupancy-Xms2048m # Maximum heap usage-Xmx3500m # Metaspace space size-XX:MaxMetaspaceSize=512m -XX:MetaspaceSize=128m Force the JVM to apply enough heap memory at startup (otherwise IDEA starts with insufficient initial heap size)3G)# -XX:+AlwaysPreTouch The ratio of young generation to old generation is1:3(The default is1:4) to reduce the recycling frequency of the young generation-XX:NewRatio=3 Stack size per thread2m # -Xss2m # # # # # # # # # # # # # # # # # # s old collector # # # # # # # # # # # # # # # # # # # # # # # # # # # # Use the CMS old age collector# -XX:+UseConcMarkSweepGC # CMS relabel step: multiple threads are executed together# -XX:+CMSParallelRemarkEnabled The G1 (Garbage First) Garbage collector8The following can be tried with the CMS collector)-XX:+UseG1GC # set the number of threads to be used by the garbage collector in parallel.-XX:ParallelGCThreads=4 # Number of threads used by concurrent garbage collector enabled4(In theory, the more the better, provided there are enough CPU cores)-XX:ConcGCThreads=2 # # # # # # # # # # # # # # # # # # the JIT compiler # # # # # # # # # # # # # # # # # # # # # # # # # # # ## code cache, used to store native code compiled Just In Time, if filled, the JVM will only interpret the execution and will not compile the native code.-XX:ReservedCodeCacheSize=512m # Hierarchical compilation, JIT compilation optimization is getting better, IDEA running time is faster as time goes by-XX:+TieredCompilation # save64Bit Pointers take up space at the cost of extra JVM overhead# -XX:+UseCompressedOops # Increase the lifetime of soft references in the JVM (the larger the heap free space, the longer)-XX:SoftRefLRUPolicyMSPerMB=50 -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true # -Djsse.enableSNIExtension=false # # # # # # # # # # # # # # # # # # log # # # # # # # # # # # # # # # # # # # # # # # # # # # ## Disallow explicit calls to system.gc () during startup-XX:+DisableExplicitGC # font-Dawt.useSystemAAFontSettings=lcd # close fastthrowTo optimize the-XX:-OmitStackTraceInFastThrow -XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log Output a memory snapshot of the heap when the heap is out of space-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof Print the GC details-XX:+PrintGCDetails Print the time stamp of the CG occurrence-XX:+PrintGCTimeStamps Print heap information before and after each GC-XX:+PrintHeapAtGC -Xbootclasspath/a:.. /lib/boot.jar-Dfile.encoding=UTF- 8 - -XX:MaxInlineLevel=3 # # # # # # # # # # # # # # # # # # other set # # # # # # # # # # # # # # # # # # # # # # # # # # # ## start assertion-ea -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine # remove bytecode validation-Xverify:none Copy the code
The plug-in
IntelliJ IDEA has a large number of plugins installed and can be removed as you like. Choose Help -> Activity Monitor to see the percentage of internal activities on the CPU. If unnecessary activities take up a large number of plug-ins, you can either disable them or uninstall them.
Activity monitor
Startup performance analysis of plug-ins
Trust me, you don’t need that much intelligence. Alibaba’s code checking is fine, but if performance doesn’t allow, real-time monitoring can be turned off, and when code is written, it may conflict with some utility classes, such as vert. x, causing the CPU to slow down and kill processes.