Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
anta40
Posts: 224
Registered: ‎07-26-2010
My Device: Z10

Thread profiling?

My app takes about more than 1 minute to open. When the app is already run, the "sending data" and "receiving data" icons keep flashing. And my BB turn to be a bit sluggish/unresponsive. 

 

I'm guessing the cause is bad thread management. Now my question is: is it possible to automatically profile all the running threads from the app? I did a quick search before, and found this. That page tells you to "Specify a breakpoint". The problem is threads are used accross the code, and I guess it would be tiresome to specify each breakpoint for them.

Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Thread profiling?

Sluggish and unresponsive immediately suggests to me that you are running stuff on the Event Thread - well written background Threads doing network I/O in my experience anyway, do not impact the UI.

 

I would add more logging to your processing so that it is clear what is actually running at any point and look for some consistency in what causes the ui sluggishness. 

 

The other common cause for sluggishness is the garbage collector, but you don't mention that at these times you see an hour glass appearing - if the garbage collector is running you will see this. 

 

My experience with profiling is that you do need to have a section of code you wish to optimize and put breakpoints around that.