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

相关推荐
似水明俊德几秒前
11-C#.Net-多线程-Async-Await篇-学习笔记
开发语言·笔记·学习·c#·.net
Byron__1 分钟前
ArrayList 与 LinkedList 源码深度对比解析
java·开发语言
Irissgwe5 分钟前
线程概念与控制
linux·开发语言·c++·线程
Yao.Li7 分钟前
python-pcl 安装排障流程
开发语言·python
SuperEugene8 分钟前
Vue3 组合式函数(Hooks)封装规范实战:命名 / 输入输出 / 复用边界 + 避坑|Vue 组件与模板规范篇
开发语言·前端·javascript·vue.js·前端框架
雨师@15 分钟前
多个golang版本如何切换的办法
开发语言·后端·golang
春日见19 分钟前
自动驾驶的四个演进阶段
开发语言·人工智能·驱动开发·matlab·docker·计算机外设
m0_7167652327 分钟前
C++提高编程--STL初识、string容器详解
java·开发语言·c++·经验分享·学习·青少年编程·visual studio
楼田莉子29 分钟前
高并发内存池项目:内存池性能分析及其优化
开发语言·c++·后端·学习
是翔仔呐36 分钟前
第6章 UART串口通信!掌握单片机与外界的双向数据通道,实现跨设备交互
c语言·开发语言·单片机·嵌入式硬件·gitee