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
New Developer
Posts: 8
Registered: ‎09-25-2008
My Device: Not Specified
Accepted Solution

System "busy" icon appearing over the top of my J2ME app...

Does anyone know how I can go about stopping the system "busy" icon appearing in the middle of the screen every few seconds?

 

My app is connecting to the net and doing a whole load of stuff, but the net-transaction icon is in the top-right and quite out of the way of any of my app's hud/screen items...

...but having this icon in the middle of the screen every few seconds is really annoying - help! :smileyvery-happy:

 

Cheers,

Paul

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: System "busy" icon appearing over the top of my J2ME app...

Don't tie up the UI thread ? I've found calling System.gc() seems to do it too.

Seriously, AFAIK, it seems to notice a backlog of stuff in the UI message queue ( I'm assuming something like that exists).

Perhaps a fews yields/sleeps would help assuming you aren't overtly blocking/using the UI thread for real work.

 

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

Re: System "busy" icon appearing over the top of my J2ME app...

I agree with marchywka - this is likely to be related to garbage collection, though I remember on the old forum, there was one user who had this because some combination of calls that he was doing got a bit cyclic.

 

I would recommend that you attach the device to the debugger and watch the output - if you see messages like

VM:+GC(F)

when the hourglass appears, then I think this will confirm that it is the OS doing a full garbage collection that is displaying it.

 

So the question then is why?  What is happening on your device at the time?

 

If you suspect your code, I would encourage you to use the profiler in the JDE.  It tells you an overwhelming amount of stuff, from the 'ticks' in various lines in your code to the amount of storage occupied by objects.  Have a play with this.  From memory I picked up how to use it from the help, though I think there is a Lab that does it as well.

New Developer
Posts: 8
Registered: ‎09-25-2008
My Device: Not Specified

Re: System "busy" icon appearing over the top of my J2ME app...

Ah.  At the moment I'm not even using the JDE - I'm using Jedit and a custom-written ANT build system :smileyhappy:

 

The System.gc() calls could be the puppy - whoever originally wrote the code I'm porting had a _lot_ of gc calls.  Cutting those right back cured by problem - thanks!

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: System "busy" icon appearing over the top of my J2ME app...

I put a call in after getting to a dead spot where nothing works - it didn't seem to help anything

but it did put up the hour glass. Hard to say if it avoids problems later but maybe you can profile your

app with and without and see if there is any net benefit.

 

 

New Developer
Posts: 8
Registered: ‎09-25-2008
My Device: Not Specified

Re: System "busy" icon appearing over the top of my J2ME app...

Aye...  as I say, it turns out that it was just the sheer volume of garbage collect calls.  Whoever wrote the code I'm porting originally had 18 unnecessary GC calls :smileyhappy: