mac intellij idea卡顿排查解决

最近我的idea异常卡顿,一顿谷歌查找后,解决。如下

1. 调整idea的JVM内存

 Help->Edit custom VM Options

-Xms2048m
-Xmx2048m
-XX:ReservedCodeCacheSize=512m
-XX:+IgnoreUnrecognizedVMOptions
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
-XX:+UseStringDeduplication
-XX:AutoBoxCacheMax=20000
# JIT 参数
# 设置用于编译的编译器线程数
-XX:CICompilerCount=2
# 开启分层编译
-XX:TieredStopAtLevel=1
# 控制最大数量嵌套调用内联
-XX:MaxInlineLevel=3
-XX:Tier4MinInvocationThreshold=100000
-XX:Tier4InvocationThreshold=110000
-XX:Tier4CompileThreshold=120000
-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

--add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
--add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED

#idea插件
-javaagent:/Users/****/ProgramFiles/active_tool/2023/jetbra/ja-netfilter.jar=jetbrains

2. 使用idea自带的内存分析工具,查看最占用cpu的插件、程序(Help -> DiagNostic Tools即可)
<unidentified: JobScheduler F] pool> 占用较高,搜索后,无具体解决办法,清除idea缓存即可。
步骤:File-Invalidate Caches/Restart

Plugin Alibaba Java Coding Guidelines: net.sourceforge.pmd.lang.java.typeresolution
关掉阿里巴巴代码实时扫描

3. 重启idea

https://jackthegeek.top/2021/03/08/%E8%AE%B0%E4%B8%80%E6%AC%A1IDEA%E5%8D%A1%E9%A1%BF%E9%97%AE%E9%A2%98/
posted @ 2024-04-19 16:20  小小虫飞飞  阅读(744)  评论(0编辑  收藏  举报