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

相关推荐
星落梦生1 小时前
SpringAOP基础笔记(7)
java·开发语言
曹牧3 小时前
Java:“刷新雪崩”
java·开发语言
郝学胜-神的一滴3 小时前
Effective STL 条款03:容器中的对象复制要廉价且正确
开发语言·数据结构·c++·算法·rpc·stl
西西弗Sisyphus4 小时前
C++ explicit 关键字工程实践
开发语言·c++
郝学胜-神的一滴6 小时前
Effective Python 条款35:用类封装替代生成器异常注入
开发语言·人工智能·python·金融·pandas·scikit-learn·matplotlib
feixing_fx6 小时前
原始类型与引用类型:赋值时到底复制了什么
开发语言·前端·javascript·前端框架
wuyk5556 小时前
Python办公自动化-第02讲-Excel文件认知与四大库选型
开发语言·python·excel
神明不懂浪漫7 小时前
【第八章】多线程(一)
java·开发语言·经验分享·笔记
yiangL_8 小时前
1、Python 输入输出实验|print 与 input 人机交互实践
开发语言·python·人机交互
山楂树の10 小时前
Java 泛型:泛型类、泛型方法、泛型接口与通配符
java·开发语言·笔记