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

相关推荐
云姜.4 分钟前
java多态
java·开发语言·c++
CoderCodingNo13 分钟前
【GESP】C++五级练习题 luogu-P1865 A % B Problem
开发语言·c++·算法
陳103020 分钟前
C++:红黑树
开发语言·c++
一切尽在,你来25 分钟前
C++ 零基础教程 - 第 6 讲 常用运算符教程
开发语言·c++
泉-java27 分钟前
第56条:为所有导出的API元素编写文档注释 《Effective Java》
java·开发语言
weixin_499771551 小时前
C++中的组合模式
开发语言·c++·算法
初级代码游戏1 小时前
套路化编程 C# winform 自适应缩放布局
开发语言·c#·winform·自动布局·自动缩放
_waylau1 小时前
鸿蒙架构师修炼之道-架构师的职责是什么?
开发语言·华为·harmonyos·鸿蒙
2的n次方_1 小时前
CANN Ascend C 编程语言深度解析:异构并行架构、显式存储层级与指令级精细化控制机制
c语言·开发语言·架构
java干货2 小时前
为什么 “File 10“ 排在 “File 2“ 前面?解决文件名排序的终极算法:自然排序
开发语言·python·算法