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

相关推荐
没有梦想的咸鱼185-1037-16636 分钟前
【生命周期评价(LCA)】基于OpenLCA、GREET、R语言的生命周期评价方法、模型构建
开发语言·数据分析·r语言
程序猿202344 分钟前
Python每日一练---第三天:删除有序数组中的重复项
开发语言·python
一只游鱼1 小时前
Springboot+BannerBanner(启动横幅)
java·开发语言·数据库
一只游鱼1 小时前
抖音上的用python实现激励弹窗
开发语言·python
行走在电子领域的工匠1 小时前
2.2 常用控件
开发语言·python
散峰而望1 小时前
Dev-C++一些问题的处理
c语言·开发语言·数据库·c++·编辑器
进击的大海贼1 小时前
QT/C++ 消息定时管理器
开发语言·c++·qt
lly2024062 小时前
TypeScript 基础类型
开发语言
whm27772 小时前
Visual Basic 菜单编辑器
开发语言·visual studio
kyle~2 小时前
原子性与原子操作
运维·服务器·开发语言·c++