IntelliJ idea卡顿解决,我遇到的比较管用的方案

Setttings> Build, Execution,Deployment>Debugger> Data Views> Java

取消 Enable "toString()" object view;


Speed up debugging in IntelliJ

Yesterday, I observed painfully slow debugging in IntelliJ. Every step over or step in took almost 10 seconds to perform.

It was a simple Java console application having about some 88k entries in few arrays. I had successfully debugged applications having millions of entries in arrays, lists and maps before without any performance issues.

Then I looked at the toString() implementation of the custom object which I was holding in the array

复制代码
 public String toString() {
        StringBuilder s = new StringBuilder();
        s.append(V + " vertices, " + E + " edges " + NEWLINE);
        for (int v = 0; v < V; v++) {
            s.append(String.format("%d: ", v));
            for (int w : adj[v]) {
                s.append(String.format("%d ", w));
            }
            s.append(NEWLINE);
        }
        return s.toString();
    }

This toString() implementation was looping over all the 88k items and IntelliJ is configured to evaluate toString() after every step.

Turning off the setting Enable toString() data views solved this problem of slow debugging.

Incase you are experiencing slow debugging issues on IntelliJ, do make sure that this setting is turned off.

参考:

Speed up debugging in IntelliJ -- Madhur Ahuja

相关推荐
浩瀚地学2 分钟前
【Java】数组
java·开发语言
陈鋆6 分钟前
Langchain-Chatchat[四、RAG对话流程代码解析]
开发语言·python·langchain
β添砖java18 分钟前
python第一阶段第九章异常、模块、包
开发语言·python
2501_9419820520 分钟前
企业微信Python SDK:高效群发消息实战
开发语言·python·企业微信
yue00820 分钟前
C# Environment类的介绍
开发语言·c#·environment
即将进化成人机28 分钟前
Spring Boot配置文件
java·开发语言·intellij-idea
龙智DevSecOps解决方案31 分钟前
Java开发基础:什么是Spring Boot?一文了解其优势、对比以及如何通过Perforce JRebel实现高效开发
java·开发语言·spring boot·jrebel·perforce·java开发
PPPPickup36 分钟前
easychat---创建,获取,获取详细,退群,解散,添加与移除群组
java·开发语言·后端·maven
liulilittle1 小时前
C++ 并发双阶段队列设计原理与实现
linux·开发语言·c++·windows·算法·线程·并发
lly2024062 小时前
并查集快速查找
开发语言