Reputation: 3093
Sometimes, when my app receives a new order via push, it hangs. Now the weird thing is that the System UI works fine, the app is unresponsive but the Application Not Responding dialog never comes.
I don't know how to debug why it is hanging. Doesn't hang everytime a new order is received, but only rarely.
Any pointers as to why the ANR might not be coming? How to debug?
Upvotes: 0
Views: 745
Reputation: 30611
You should observe the app behavior in the monitor. If the CPU / Memory usage is inordinately high, it could be indicative of either a memory leak or a CPU-intensive task (like an unpurged TimerTask
or multiple instances of the same Runnable
) that causes the app to become unresponsive without an ANR.
In case it does turn out to be a memory leak, you could investigate further with LeakCanary or monkey to further narrow down the exact cause of the leak.
I once came across an animated progress dialog that caused both a huge memory leak AND a CPU overload, causing my app to hang without throwing an exception.
Upvotes: 1