Intellij Debugger slow: Method breakpoints may dramatically slow down debugging

前端 未结 6 1188
你的背包
你的背包 2020-12-13 03:21

When I start intellij debugger, it comes the the hint you can see in the screenshot. the debugger takes a lot of time to start. How to solve this problem?

相关标签:
6条回答
  • 2020-12-13 03:45

    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.

    To make the long story short, it seems that the root issue is that Method Breakpoints are implemented by using JPDA's Method Entry & Method Exit feature. This implementation requires the JVM to fire an event each time any thread enters any method and when any thread exits any method.

    0 讨论(0)
  • 2020-12-13 03:45

    Turn off the method breakpoint from the debug panel. Here is a screenshot.

    0 讨论(0)
  • 2020-12-13 03:47

    In IDEA 2017.1 Emulated Method Breakpoints were introduced: https://www.jetbrains.com/help/idea/using-breakpoints.html#method_breakpoint They allow using method breakpoints without the performance penalty. Enabled by default.

    0 讨论(0)
  • 2020-12-13 03:55

    Turn off the method breakpoints. You can see all your breakpoints through Run | View Breakpoints (Ctrl - Shift -F8 )

    0 讨论(0)
  • 2020-12-13 03:56

    Look for the red diamond icons (not red circles) in your code, those represent the method breakpoints. Most probably you set them at get()/set() methods in Kotlin.

    0 讨论(0)
  • 2020-12-13 04:07

    Practical advice that I follow: 1. mute all the breakpoints while the app is coming up 2. enable breakpoints only while debugging that flow.

    Of course, it won't help if you are trying to debug something which happens during app startup.

    0 讨论(0)
提交回复
热议问题