Click here to Skip to main content
15,867,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I made a Download Manager using Java Swing. The GUI becomes unresponsive after a while. Every download is implemented as a new thread. Only the GUI updates are run on the Event Dispatch Thread. How can I improve GUI performance of a swing program, in general. Also are there any good tools to make GUIs in C?

[Edit]Shouting removed[/Edit]
Posted
Updated 28-Apr-13 4:21am
v2
Comments
Shubhashish_Mandal 29-Apr-13 2:17am    
Without the code its very tough to predict the glitch. You should check at what point the application got frizz.

1 solution

There are many things that can make a process, not just a UI component, unresponsive. The solution depends upon what is causing the problem. This is a classic case of needing to analyse and debug.

First thing to do is see if you can reproduce the problem. From your post it sounds like this happens regularly. Ask yourself is it triggered by a specific event? Are you suddenly downloading a particular type of file or large sized file? If you can find a reproduction step it will make testing any solution that much easier.

Next up, examine the profile of the process when it bugs out. Is the CPU being used heavily? If so it indicates a dead loop than can never be exited. Maybe there is no CPU usage which indicates that the thread is hung waiting for a notify that never comes.

Thirdy, check your memory profile. Is memory usage excessive relative to normal running? If so is the app trying to allocate a large swath of memory on the heap that is taking time or trying to release it so tying up the JVM.

When you get an idea, try logging the process - write messages at entry and exit points for each large running function, see if one or more is beginning to take more time.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900