修改前:
-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:CICompilerCount=2
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-ea
-Dsun.io.useCanonCaches=false
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
修改后:
-Xms1024m
-Xmx2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-XX:CICompilerCount=2
-Dsun.io.useCanonPrefixCache=false
-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
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
主要參數(shù)及說明
說明:
1.Xms128m--最小內(nèi)存
2.Xmx750m--最大內(nèi)存
3.預(yù)留代碼緩存的大小
4.UseConcMarkSweepGC--設(shè)置年老代為并發(fā)收集
-XX:+UseG1GC 設(shè)置垃圾回收為G1模式
這里我保留了G1的垃圾回收方式。
-XX:+UseG1GC
據(jù)說G1垃圾回收是目前的主流
還有可能的情況
IDEA中阿里巴巴代碼規(guī)范插件是否開啟了實時掃描
禁用Git插件
-
IDEA中是否安裝了過多的插件,從而導(dǎo)致性能下降
也可以開啟IDEA中開啟內(nèi)存提醒。
IntelliJ IDEA--->Preferences找到Appearance & Behavior--->Appearance勾選Disable mnemonics in menu
iShot_2022-06-09_15.09.42.png
