wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes Threads waiting in pool? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Threads waiting in pool?" Watch "Threads waiting in pool?" New topic

Threads waiting in pool?

Pat Short

Joined: Mar 21, 2008
Posts: 22
I'm using an MDB driven architecture to take messages from a queue and persist them in a database. For this, I've configured a pool of Listener Ports to take messages from the queue. When I run a stress test and take a core dump, I see a number of threads waiting at the same location (see stack trace below). What does this mean? Is my CPU the limiting factor? It seems to be operating at about 80% during this time? Or is the database my limiting factor. I see very few threads waiting on the database.

3XMTHREADINFO "MessageListenerThreadPool : 72" (TID:0x398C2C00, sys_thread_t:0x398AD85C, state:CW, native ID:0x002CD143) prio=5
4XESTACKTRACE at java/lang/Object.wait(Native Method)
4XESTACKTRACE at java/lang/Object.wait(Object.java:231(Compiled Code))
4XESTACKTRACE at com/ibm/ws/util/BoundedBuffer.waitGet_(BoundedBuffer.java:188(Compiled Code))
4XESTACKTRACE at com/ibm/ws/util/BoundedBuffer.poll(BoundedBuffer.java:598(Compiled Code))
4XESTACKTRACE at com/ibm/ws/util/ThreadPool.getTask(ThreadPool.java:816(Compiled Code))
4XESTACKTRACE at com/ibm/ws/util/ThreadPool$Worker.run(ThreadPool.java:1476)

Any help greatly appreciated.

Santhosh Kumar
Ranch Hand

Joined: Nov 07, 2000
Posts: 242
I'm not sure which component this class belongs to, com/ibm/ws/util/BoundedBuffer. Assuming this belongs to messaging system you are using, looks like they are waiting for messages to be read. Are you publishing enough number of messages to keep all the threads busy processing them?
Pat Short

Joined: Mar 21, 2008
Posts: 22
Thanks for the quick reply. I'm using WebSphere Application Server and WebSphere MQ for messaging.

I pre-load my queue with thousands of messages so one would think that the supply of messages is not the problem. However, the threads in the pool seem to be waiting for work which is what I don't understand.

I cant understand where my bottle neck is.
Chandan Ghosh

Joined: Jun 13, 2005
Posts: 21
I am not sure but are you ensured about only one message listener thread pool in the application server because only one message listener thread pool can exists per application server and all listener port in the server will use thread from this pool.

Thanks & Regards,<br />Chandan Ghosh<br />SCJP1.4
Pat Short

Joined: Mar 21, 2008
Posts: 22
The listener port thread pool seems to only utilize 2/3 threads for MQGets. All the rest are in a wait state despite the fact that the queue is saturated. Also, further investigation of the core dumps also so an MQQueueAgent thread also waiting on MQ. Is this the dispatcher thread which hands off to my other listener port threads? Is this what is preventing greater utilization of my thread pool? Thanks
Pat Short

Joined: Mar 21, 2008
Posts: 22
Changing to NON-ASF mode for my ListenerPort fixed the problem of under utilization of the thread pool. See details here http://www.ibm.com/developerworks/websphere/library/techarticles/0611_titheridge/0611_titheridge.html
I agree. Here's the link: http://aspose.com/file-tools
subject: Threads waiting in pool?
Similar Threads
Creating Core java dump in unix when converting pdf to text file.
Tomcat 6.0.35 hangs during startup
Tomcat 6 crash
WebSphere error
Server crash