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

相关推荐
fengfuyao98522 分钟前
基于MATLAB的GUI实现人脸检测、眼睛检测以及LBP直方图显示
开发语言·计算机视觉·matlab
CHANG_THE_WORLD40 分钟前
# C++ 中的 `string_view` 和 `span`:现代安全视图指南
开发语言·c++
Franklin1 小时前
Python界面设计【QT-creator基础编程 - 01】如何让不同分辨率图像自动匹配graphicsView的窗口大小
开发语言·python·qt
郝学胜-神的一滴1 小时前
深入理解QFlags:Qt中的位标志管理工具
开发语言·c++·qt·程序人生
柯南二号2 小时前
【Java后端】MyBatis-Plus 原理解析
java·开发语言·mybatis
我是哈哈hh2 小时前
【Node.js】ECMAScript标准 以及 npm安装
开发语言·前端·javascript·node.js
Sammyyyyy4 小时前
2025年,Javascript后端应该用 Bun、Node.js 还是 Deno?
开发语言·javascript·node.js
William一直在路上4 小时前
Python数据类型转换详解:从基础到实践
开发语言·python
看到我,请让我去学习5 小时前
Qt— 布局综合项目(Splitter,Stacked,Dock)
开发语言·qt
GUET_一路向前5 小时前
【C语言防御性编程】if条件常量在前,变量在后
c语言·开发语言·if-else·防御性编程