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
Regular Contributor
nunonobre
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520

Queue too large

My application is terminating because of the error: "Queue too large ". How many Threads could my application run at same time? How can I avoid this?

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Queue too large

You're probably calling invokeLater() too many times.

Regular Contributor
nunonobre
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520

Re: Queue too large

Hi,

I never used the invokeLater. I have several Threads running in background, almost 15/16. How can I avoid this? Is there any queue when we can put threads to run later?
Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Queue too large

there is none in the API, but you can write one yourself.
we have an executor queue that runs up to three threads, it uses a queue where you add runnables, which in turn notifies one of the threads to wake up and work on it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Queue too large

May be this link useful.

 

http://blog.vimviv.com/j2me/taskworker-thread-blackberry/

 

Thanks.

Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Queue too large

1) What is the full error?

2) What makes you think it is because you have too many threads? There would be a TooManyThreads error if that were the case (http://supportforums.blackberry.com/t5/Java-Development/TooManyThreadsError/ta-p/444894)

3) What can you tell us about what you're threads are doing?

 

There are several ways I've seen the "Queue too large":

1) Event injection called too fast (http://supportforums.blackberry.com/t5/Java-Development/163-queue-too-large-key-stylus-event-s-dropp...)

2) UiApplication.invokeLater called too often, filling up the UI queue (http://supportforums.blackberry.com/t5/Java-Development/Process-myapp-325-queue-too-large-76-user-in...)

3) Long running task on UI thread blocking UI execution, causing input events to build up in the queue. (http://supportforums.blackberry.com/t5/Java-Development/process-myapp-288-queue-too-large-31-user-in...)

Regular Contributor
nunonobre
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520

Re: Queue too large

Hi,

 

The full error is: queue too large (76); user input event(s) dropped. After this I get another error: is not responding; process terminated.

 

Regular Contributor
nunonobre
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520

Re: Queue too large

Sorry I forgot to answer the other questions.

2.I thought in the TooManyThreads issue because my application has some Threads running in background.

3. My threads are updating UI, making some Http tests, sending reports files...
Regular Contributor
nunonobre
Posts: 64
Registered: ‎09-21-2011
My Device: Curve & 8520

Re: Queue too large

After the erros I added, at the end I got a ForcedStackTraceException from several applications
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Queue too large

What method are you using to update the UI? invokeAndWait? Synchronized on the event lock?

Can you confirm that your code for the ui update is quick and doesn't do anything like network calls?