App freezes for 10 seconds with strange error in console

I'm having a real difficult time narrowing down a bug. I have a very simple app that runs a single thread that waits for HTTP requests in a queue. The thread sleeps for 50ms and then checks for new items in the queue. If there are new items the thread will perform the http request.

Sometimes when I wake the BlackBerry up from the black screen and unlock it I find the app is unresponsive. The UI doesn't change. I hooked up my device to see the console logs and when i'm tapping UI items i get the following:

Re: App freezes for 10 seconds with strange error in console

My suspicion is an issue with the update processing when you get the data back from the Thread, or some access to Persistent store being refused because your device is locked. Make sure you are logging your activity and then check the log for the period the device was locked. The easiest thing to do would be to debug from a PC, but I'm not sure the BB will go into the state you see a problem with when connected.

Re: App freezes for 10 seconds with strange error in console

The most likely cause is running networking stuff on the Event Thread. If you are running listeners (like listening to incoming calls and the like) then code running in the listeners needs to be really tight or that can cause similar problems. In addition, it could be a memory issue - is the garbage collector 'timer' displaying at this time?

Make sure there is plenty of logging in your application, and monitor this and the normal logging while the problem is occurring. I think from there you will determine what you are doing wrong in your app.