I have an android app that is getting fairly large and complex now, and it seems to have intermittent performance problems. One time I will run the app and it’s fine, another time it will struggle when switching views.
How can I detect the causes of the performance problem using debugging tools so that I may correct it?
Use the
ddmstool which comes with the SDK. It has a nice feature called Allocation Tracker that allows you to see in real time how much memory your code is consuming and what specific line is causing that.Most of the cases your app will slow down because of bad adapter implementations, poor layout inflation techniques or not using a cache system to decode
Bitmaps(such as using SoftReference).Take a look at this article for a brief explanation: Tracking Memory Allocations