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

相关推荐
刚入门的大一新生44 分钟前
C++初阶-C++入门基础
开发语言·c++
你是理想1 小时前
wait 和notify ,notifyAll,sleep
java·开发语言·jvm
forestsea1 小时前
Python进阶编程总结
开发语言·python·notepad++
q567315231 小时前
使用Java的HttpClient实现文件下载器
java·开发语言·爬虫·scrapy
六bring个六2 小时前
QT上位机笔记
开发语言·笔记·qt
步木木2 小时前
Qt 5.14.2入门(一)写个Hello Qt!程序
开发语言·qt
techdashen2 小时前
Rust主流框架性能比拼: Actix vs Axum vs Rocket
开发语言·后端·rust
普通网友2 小时前
内置AI与浏览器的开源终端Wave Terminal安装与远程连接内网服务器教程
开发语言·后端·golang
南玖yy2 小时前
探索 C 语言数据结构:从基础到实践
c语言·开发语言·数据结构
_清浅3 小时前
JavaScript(JS进阶)
开发语言·前端·javascript·操作系统·html5