Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intelliji idea is very slow in debug mode and it is running perfectly in normal mode

Intelliji idea is very slow in debug mode and it is running perfectly in normal mode.

I already tried by setting the below thing in /etc/hosts file sudo nano /etc/hosts and add these two entries.

127.0.0.1 .local ::1 .local

But it did not work out for me.

Any help on this is highly regarded.

like image 432
swathi Avatar asked Sep 19 '17 04:09

swathi


People also ask

Why is IntelliJ debugging slow?

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.

Is running in debug mode slower?

It's slow because debug mode turns off the optimiser and enables a bunch of expensive runtime checks, such as out-of-bounds array indexing and memory overrun detection. The core issue is that you simply have very unrealistic expectations of how fast the code should be in a Debug build.

Why are method breakpoints slow?

Method breakpoints will slow down debugger a lot because of the JVM design, they are expensive to evaluate. Remove method breakpoints and consider using the regular line breakpoints. To verify that you don't have any method breakpoints open .

How do I get out of loop while debugging in IntelliJ?

The only way to do that is to set a break point outside the loop, or position the cursor outside the loop and do "run until cursor".


3 Answers

Remove breakpoints off your method and use them inside the method as that can cause your debug to take a very long time.

Try running IntelliJ as admin. I had this issue at work where debugging was extremely slow and running as admin actually made it a lot faster.

Method breakpoints may dramatically slow down debugging

There is a simple explanation from the IntelliJ Team: "Method breakpoints will slow down debugger a lot because of the JVM design, they are expensive to evaluate"

https://intellij-support.jetbrains.com/hc/en-us/articles/206544799-Java-slow-performance-or-hangups-when-starting-debugger-and-stepping

like image 112
Moe Avatar answered Oct 13 '22 01:10

Moe


I had the similar issue. In my case it was method breakpoints. There was just one break point on a method. My spring boot app took around 20 mins to launch. When I removed the breakpoints it took 4 seconds to launch.

I also changed the debugger settings.

  1. Unchecked - Enable alternative view view for Collections classes
  2. Unchecked - Enable 'toString()' object view:

but these settings didn't make a difference.

like image 32
Arul Rozario Avatar answered Oct 12 '22 23:10

Arul Rozario


If you disable this options in Build, Execution, Deployment -> Debugger -> Data Views --> Java, things will start work faster when debugging.

enter image description here

like image 12
Eyal Sooliman Avatar answered Oct 13 '22 00:10

Eyal Sooliman