Board index » jbuilder » CPU consumption - Swing app

CPU consumption - Swing app


2004-09-30 11:27:53 PM
jbuilder18
This might really be a Swing topic - I'm not sure. It's just that I am using JBuilder for the first time (we are using JBuilder X) and happen to be doing a Swing project also.
Recently my app has begun to chew up large amounts of CPU resources as shown by the Windows Task Manager (Windows 2000 Pro) when I run my app from inside JBuilder. By 'large' I mean that it jumps to 70-80% at times and then drops. This happens when events are firing that redraw my GUI. It makes the GUI slow sometimes.
I've tried to take care to make sure that GUI updates are happening inside invokeLater() calls - that seems OK. What puzzles me is that when I run the app from the command line - outside JBuilder - I don't see this behavior. I would expect that if I am trying to run GUI updates and monopolizing the event handling thread that the GUI would be slow outside of JBuilder as well.
I am paranoid that I have some threading issue that is showing up only in the IDE. I never see deadlock, but ... ya never know, I suppose ...
I'm just puzzled. Might it be just that the IDE consumes lots of CPU at some points ? Hoping some of you more experienced people can give me some feedback - I'd appreciate any wisdom.
Thanks in advance !
 
 

Re:CPU consumption - Swing app

Ethan wrote:
Quote
This might really be a Swing topic - I'm not sure. It's just that I am using JBuilder for the first time (we are using JBuilder X) and happen to be doing a Swing project also.

Recently my app has begun to chew up large amounts of CPU resources as shown by the Windows Task Manager (Windows 2000 Pro) when I run my app from inside JBuilder. By 'large' I mean that it jumps to 70-80% at times and then drops. This happens when events are firing that redraw my GUI. It makes the GUI slow sometimes.

I've tried to take care to make sure that GUI updates are happening inside invokeLater() calls - that seems OK. What puzzles me is that when I run the app from the command line - outside JBuilder - I don't see this behavior. I would expect that if I am trying to run GUI updates and monopolizing the event handling thread that the GUI would be slow outside of JBuilder as well.

I am paranoid that I have some threading issue that is showing up only in the IDE. I never see deadlock, but ... ya never know, I suppose ...

I'm just puzzled. Might it be just that the IDE consumes lots of CPU at some points ? Hoping some of you more experienced people can give me some feedback - I'd appreciate any wisdom.

Thanks in advance !
When you run your app from within JBuilder, it actually spawns a
separate VM to do so. But JBuilder does "attach" itself to that app for
a variety of reasons, depending on various options selected. Part of the
slow-down may be due to that. Hard to say without knowing what the app
is doing.
Tad Frysinger (TeamB)