DEV Community

igor.kulakov
igor.kulakov

Posted on • Updated on

Fix 'Processing classes for emulated method breakpoints'

When debugging code in IntelliJ IDEA or Android Studio, you may have seen a dialog that reads Processing classes for emulated method breakpoints. It appears when you set method breakpoints, and the process may sometimes take long to complete.

In this article we'll briefly look at why it happens and consider the ways to fix the problem.

Why it appears

The reason for this dialog is the default way IntelliJ IDEA and Android Studio handle method breakpoints. Since Java method breakpoints can significantly slow down the running application, IntelliJ IDEA and Android Studio emulate them by setting regular line breakpoints in the bodies of the target method and its derivatives.

Emulated method breakpoints really speed things up, however they may be problematic with methods that have numerous implementations. This depends on several factors, but usually the problem arises when setting a method breakpoint on a method with thousands or tens of thousands of implementations.

How to fix

There are two ways to fix the problem, depending on your goal:

  • if the target method is not called too often, and you are fine with slower performance, you can use a traditional method breakpoint. For this, right-click the breakpoint and uncheck the Emulated checkbox.
  • if you don't need to target all the implementations, you can set method or line breakpoints on the required implementations. This will keep the improved runtime performance, but might be a little bit more tedious if you target many derived methods.

Conclusion

In this brief article I dropped everything extra, so that those who are experiencing the described problem could solve it quickly. If you like more in-depth guides and tutorials, make sure to check out my other articles on debugging:

See you in the future posts!

Top comments (0)