androidandroid-studiodebuggingfreeze

Android Studio low performance in the debug mode


I am new to Android and I've encountered a problem. I am using Android Studio 2.3, and everything was fine at first. However, after some time, I noticed that the app hangs while I'm debugging. It freezes and works very slowly. If I turn off debugging, the app works fine. I tried to clean the cache on both the device and in Studio, but it did not help. I set aside my laptop and continued working on another PC. At first, everything was good, but the problem returned. I can't figure out the reason or how to fix it. Has anybody faced the same problem?


Solution

  • As WieFel wrote, debugger will obviously stop at any breakpoints you created. Make sure that you are not setting your breakpoints on whole methods, as it can cause your debugger to be incredibly slow. Breakpoints should be ideally targeted at single lines of code. You can see all of the breakpoints you've set by Run... -> View Breakpoints or Cmd/Ctrl + Shift + F8.