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

相关推荐
_extraordinary_40 分钟前
Java Spring配置
java·开发语言·spring
进击的大海贼1 小时前
QT-C++ 自定义加工统计通用模块
开发语言·c++·qt
Rhys..1 小时前
JS - npm init
开发语言·javascript·npm
newxtc1 小时前
【 广州产权交易所-注册安全分析报告-无验证方式导致安全隐患】
开发语言·人工智能·selenium·安全·yolo
兩尛1 小时前
java八股-操作系统
java·开发语言
wjs20241 小时前
SQL 日期处理指南
开发语言
川石课堂软件测试2 小时前
CSS中常用的几种定位。
开发语言·css·python·网络协议·http·html·pytest
叶落阁主2 小时前
IdeaVim 新插件推荐- Vim CmdFloat 优化搜索/命令执行框
pycharm·vim·intellij idea
友友马2 小时前
『 QT 』QT信号机制深度解析
开发语言·qt
清风wxy2 小时前
C语言基础数组作业(冒泡算法)
c语言·开发语言·数据结构·c++·windows·算法