Reputation: 11
I've tried debugging my application in Android Studio/Eclipse and both yield same result, very slow debugging (1-15 frames per second) with my samsung note3. The funny part is that without a debugger attached to the application, the application runs just fine (60 frames per second).
I've removed all break points in Android Studio (installed today from scratch), same with eclipse, both yield same behavior. I've recreated the existing application project a few times, with no luck. I've also removed all expressions as well, no luck.
I've done method tracing with and without a debugger. The times/invocation counts look very similar and there isn't any obvious outliers.
The moment I turn off debugging, the application instantly goes back up to 60fps.
I'm going to ask my friend to try it on his device (an htc phone) and see if he can reproduce. I should mention, I do think that somehow I'm causing extra overhead with the debugger with my application, cause I created a simple open gl surface, and it debugged just fine. I should also mention, I've tried 3 different usb cords, and all yield same result.
My app is multi threaded and makes use of large object pools.
Any ideas?
Upvotes: 1
Views: 588
Reputation: 52343
If you're doing a lot of computation in Java code, this may be expected.
When running normally, Dalvik executes code with the "fast" interpreter, and uses the JIT to compiler any hot sections. When the debugger attaches, it runs exclusively in the "debug" interpreter, which is much slower.
Some operations, such as "step over", can be fairly painful. ("Run to line" should execute more quickly.)
Upvotes: 2