Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why using method breakpoints in IntelliJ IDEA causes such slowdown?

I've always known that method breakpoints make programme run a lot slower in debugger compared to a normal breakpoint.

Could someone with deep knowledge of debugger explain in relatively layman's language why is it so?

Thank you!


UPDATE

Thank you for the reply. I understand several similar questions have been asked here in the past, but I find none of them offer a detailed explanation and most of the answers point it out as "JVM design" without giving further details.

I know it's not always easy to explain complex subjects such as this in simple terms, but would appreciate if someone with the knowledge could try to explain it. I'd like to have a slightly better understanding of the subject than just knowing to avoid it.

Thanks!

like image 928
Andy Avatar asked Mar 09 '17 16:03

Andy


People also ask

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 .

Why is IntelliJ debugger so slow?

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.

Is running in debug mode slower?

debug code runs a lot slower than release - Visual Studio Feedback.

What is a method breakpoint IntelliJ?

Breakpoints are special markers that suspend program execution at a specific point. This lets you examine the program state and behavior.

What is the default breakpoint in IntelliJ IDEA?

By default, IntelliJ IDEA sets an emulated method breakpoint, which is a combination of line breakpoints set at first statements of all implementing or overriding methods. Such emulated breakpoints do not impact the debugged application performance, while "true" method breakpoints slow the debugger dramatically due to the JVM design.

Why do method breakpoints slow down the debugger?

From the JetBrains Team: "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.". See more.

Why is my IntelliJ IDEA so slow?

Also, please remember that IDEA consumes a lot of RAM memory and your system may not have enough memory for other processes causing it to use disk swap and thus degrade performance significantly. Is your code slow anywhere? Wel Which is better for Java development: Eclipse or IntelliJ IDEA?

Why should I use IntelliJ IDEA?

After all IntelliJ is a payed platform and it should run fast. Note: i also teach a free course Become an IntelliJ IDEA guru where you can find more about different actions you can use in IntelliJ. Why use Intellij IDEA over Eclipse? goddamn miracle The code completion is miles ahead of any other IDE, not just the Java ones.


1 Answers

Method breakpoints are extremely expensive to evaluate. According to JetBrains, the JVM isn't set up to handle this efficiently.

like image 69
BamaPookie Avatar answered Nov 15 '22 07:11

BamaPookie