Event Dispatch thread slows down after running for a while.

Hi,

we are building a real time Java swing GUI that asynchronously processes lot of messages. IT runs very well for few hours but after sometime, suddenly, we start seeing grey screens. The get painted very slowly. The Event dispatch thread responds the user events very slowly. I checked the CPU usage of the java process. The java process only takes 15%. But, If I see the total CPU usage in the task manager, the CPU usage goes up to 60% when this happens. If I exit the GUI, the whole CPU goes to 0.

It seems like something is queuing too many runnable objects to the Queue or may be the Event Dispatch thread is waiting on some monitor lock which is being locked by some other thread.

I am not able to debug this situation. I am unable to run this in a debugger as it is happening on the User's machine. Also, this is happening randomly.

My question is following:

Is there any tool, utility or any API that I can use to get the threads information, GC information, contents inside the event queue, event queue size and what event dispatch thread is doing exactly etc.

I appreciate any help.

Thankyou

Mohan

[1166 byte] By [tvmohana] at [2007-9-25]
# 1

You can use JMX console, but there is also another easier way.

Use the free stack trace tool. The user can download it and generate a thread dump on the running java process. It's from here:

http://tmitevski.users.mcs2.netarray.com/trace.do

After you generate a sample of thread dumps while it is going slow you should be able to get a good picture of what exactly the event dispatcher is doing.

jvaudrya at 2007-7-14 > top of java,Desktop,Core GUI APIs...