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 小时前
C++ 数组:一维数组的定义、遍历与常见操作
java·开发语言·数据结构·c++·学习·数组·知识
TTGGGFF2 小时前
控制系统建模仿真(一):掌握控制系统设计的 MAD 流程与 MATLAB 基础运算
开发语言·matlab
2501_944424122 小时前
Flutter for OpenHarmony游戏集合App实战之贪吃蛇食物生成
android·开发语言·flutter·游戏·harmonyos
Lhuu(重开版4 小时前
JS:正则表达式和作用域
开发语言·javascript·正则表达式
仙俊红4 小时前
Java Map 家族核心解析
java·开发语言
浅念-4 小时前
C语言小知识——指针(3)
c语言·开发语言·c++·经验分享·笔记·学习·算法
code_li5 小时前
聊聊支付宝架构
java·开发语言·架构
少控科技5 小时前
QT高阶日记01
开发语言·qt
无限进步_6 小时前
【C++】大数相加算法详解:从字符串加法到内存布局的思考
开发语言·c++·windows·git·算法·github·visual studio
“抚琴”的人6 小时前
C#上位机工厂模式
开发语言·c#