143

When I start IntelliJ debugger, it shows a tooltip that says:

Method breakpoints may dramatically slow down debugging

Screenshot: tooltip: Method breakpoints may dramatically slow down debugging

The debugger takes a long time to start. How can I solve this problem?

Pang
  • 9,564
  • 146
  • 81
  • 122
Ronald
  • 2,721
  • 8
  • 33
  • 44

8 Answers8

276

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

enter image description here

mattsmith5
  • 540
  • 4
  • 29
  • 67
Robin
  • 36,233
  • 5
  • 47
  • 99
  • 49
    But surely removing your breakpoints defeats the purpose of debugging? Or I'm missing something. – arush436 Oct 08 '15 at 08:47
  • 24
    @arush436 The number of situations where you need a "method breakpoint" (!= regular breakpoint) are very limited. – Robin Oct 08 '15 at 10:31
  • 47
    And what is the difference then between a method breakpoint and a regular breakpoint? – jmrah Feb 07 '17 at 15:40
  • 10
    @jrahhali See [Method breakpoint](https://www.jetbrains.com/help/idea/types-of-breakpoints.html#method_breakpoint) and [Line breakpoint](https://www.jetbrains.com/help/idea/types-of-breakpoints.html#d1012784e109) – happy_coder Jun 18 '17 at 01:29
  • 10
    Here's an updated link to the different [types of breakpoints](https://www.jetbrains.com/help/idea/using-breakpoints.html#breakpoint-types). – Cameron Jan 13 '20 at 16:14
  • For most scenarios, you definitely DO NOT want this enabled. It has its uses, of course, but was likely enabled unintentionally by the developer when clicking through their debug tools. – Michael M Aug 23 '22 at 21:42
  • Thanks, works in Android Studio Chipmonk | 2021.2.1 Patch 2 – slogan621 Nov 26 '22 at 21:10
35

enter image description here

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

Chetan Gaikwad
  • 1,268
  • 1
  • 13
  • 26
15

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.

Tagir Valeev
  • 97,161
  • 19
  • 222
  • 334
Egor
  • 2,474
  • 17
  • 19
  • 2
    If you see this message you may have (like me) clicked "Cancel emulation" on a popup. To re-enable it go to the break point in show-breakpoints and check "Emulated". – Captain Man Mar 18 '20 at 19:12
10

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.

SamB
  • 9,039
  • 5
  • 49
  • 56
nhoxbypass
  • 9,695
  • 11
  • 48
  • 71
7

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.

blade
  • 804
  • 1
  • 9
  • 18
  • Unfortunately this warning goes off with breakpoints set in `onClick` methods, which are *very useful* places to put a breakpoint. And they won't cause a slow-down at all. Sigh. – SMBiggs May 05 '21 at 18:36
5

In my case, I used Android Studio, When I set Break-Point on a method name line (called Java Method Break-Point), The Android Studio show me the this warning and debugging was so slow...

By removing this Break-Point my problem solved...

enter image description here

enter image description here

ultra.deep
  • 1,699
  • 1
  • 19
  • 23
  • 1
    thank you this solved my issue. I had accidentally added method breakpoint in a interface class.. I just wasted 8 hrs scratching my head, installing new version of IntelliJ. Your post helped me :-) – aaru Sep 09 '21 at 15:21
1

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.

Pang
  • 9,564
  • 146
  • 81
  • 122
Sudip Bhandari
  • 2,165
  • 1
  • 27
  • 26
-2

View Breakpoints - (Ctrl - Shift -F8 ) Remove all method Breakpoints. rerun the application in debugging mode . its working f