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

相关推荐
KYGALYX4 小时前
服务异步通信
开发语言·后端·微服务·ruby
zmzb01034 小时前
C++课后习题训练记录Day98
开发语言·c++
猫头虎5 小时前
如何排查并解决项目启动时报错Error encountered while processing: java.io.IOException: closed 的问题
java·开发语言·jvm·spring boot·python·开源·maven
YUJIANYUE6 小时前
PHP纹路验证码
开发语言·php
仟濹6 小时前
【Java基础】多态 | 打卡day2
java·开发语言
孞㐑¥6 小时前
算法——BFS
开发语言·c++·经验分享·笔记·算法
Re.不晚6 小时前
JAVA进阶之路——无奖问答挑战2
java·开发语言
八零后琐话6 小时前
干货:程序员必备性能分析工具——Arthas火焰图
开发语言·python
3GPP仿真实验室6 小时前
【MATLAB源码】CORDIC-QR :基于Cordic硬件级矩阵QR分解
开发语言·matlab·矩阵
知南x6 小时前
【Ascend C系列课程(高级)】(1) 算子调试+调优
c语言·开发语言