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

相关推荐
always_TT9 分钟前
C语言中的字符与字符串(char数组)
c语言·开发语言
forAllforMe28 分钟前
LAN9252 从机寄存器配置--C语言举例
c语言·开发语言
weixin_5375904540 分钟前
《C程序设计语言》练习答案(练习1-4)
c语言·开发语言
chushiyunen1 小时前
python中的内置属性 todo
开发语言·javascript·python
麦麦鸡腿堡1 小时前
JavaWeb_请求参数,设置响应数据,分层解耦
java·开发语言·前端
2301_819414301 小时前
C++与区块链智能合约
开发语言·c++·算法
不想看见4042 小时前
Valid Parentheses栈和队列--力扣101算法题解笔记
开发语言·数据结构·c++
炸膛坦客2 小时前
单片机/C/C++八股:(十五)内存对齐、结构体内存对齐
c语言·开发语言·单片机
娇娇yyyyyy2 小时前
QT编程(13): Qt 事件机制eventfilter
开发语言·qt
bcbobo21cn2 小时前
C# byte类型和byte数组的使用
开发语言·c#·字节数组·byte类型