IDEA 启动参数优化

Idea2020 vmoptions 推荐(CMS 垃圾收集器)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
-ea
-server
-Xms1g
-Xmx4g
-Xss16m
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=2g
-XX:ConcGCThreads=6
-XX:ParallelGCThreads=6
-XX:NewRatio=1
-XX:ReservedCodeCacheSize=512m
-XX:+AlwaysPreTouch
-XX:+UseConcMarkSweepGC
-XX:+DoEscapeAnalysis
-XX:+TieredCompilation
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:+UnlockExperimentalVMOptions
-Djava.net.preferIPv4Stack=true
-Dsun.io.useCanonCaches=false
-XX:LargePageSizeInBytes=256m
-XX:+UseCodeCacheFlushing
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:+UseCompressedOops
-XX:-OmitStackTraceInFastThrow
-Dfile.encoding=UTF-8
-Xverify:none

-XX:ErrorFile=/Users/zhanghao/logs/idea/idea2020_error_%p.log
-XX:HeapDumpPath=/Users/zhanghao/logs/idea/idea2020_error.hprof

Idea2021 vmoptions 推荐(G1 垃圾收集器)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
-ea
-server
-Xms1g
-Xmx4g
-Xss16m
-XX:MetaspaceSize=1g
-XX:MaxMetaspaceSize=2g
-XX:ConcGCThreads=6
-XX:ParallelGCThreads=6
-XX:NewRatio=1
-XX:ReservedCodeCacheSize=512m
-XX:+AlwaysPreTouch
-XX:+UseG1GC
-XX:+DoEscapeAnalysis
-XX:+TieredCompilationUseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:+UnlockExperimentalVMOptions
-Dsun.io.useCanonPrefixCache=false
-Djava.net.preferIPv4Stack=true
-Dsun.io.useCanonCaches=false
-XX:LargePageSizeInBytes=256m
-XX:+UseCodeCacheFlushing
-XX:+DisableExplicitGC
-XX:+ExplicitGCInvokesConcurrent
-XX:+PrintGCDetails
-XX:+PrintFlagsFinal
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:CMSInitiatingOccupancyFraction=60
-XX:+CMSParallelRemarkEnabled
-XX:+UseAdaptiveGCBoundary
-XX:+UseSplitVerifier
-XX:CompileThreshold=10000
-XX:+OptimizeStringConcat
-XX:+UseStringCache
-XX:+UseFastAccessorMethods
-XX:+UnlockDiagnosticVMOptions
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Djdk.attach.allowAttachSelf=true
-Dkotlinx.coroutines.debug=off
-Djdk.module.illegalAccess.silent=true
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-Xverify:none
-XX:CICompilerCount=2

-XX:ErrorFile=/Users/zhanghao/logs/idea/idea2021_error_%p.log
-XX:HeapDumpPath=/Users/zhanghao/logs/idea/idea2021_error.hprof