Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » javaw.exe keeps running in Windows
javaw.exe keeps running in Windows [message #449332] Fri, 21 January 2005 21:34 Go to next message
Bill Ewing is currently offline Bill EwingFriend
Messages: 49
Registered: July 2009
Member
In Task Manager, you see an instance of javaw.exe (Windows' jvm launcher)
appear when you start eclipse. We see another instance appear when we run
our JFace app (either under eclipse or standalone).

After exiting our app, its javaw.exe does not disappear from Task Manager.
They pile up, one for each run. Eventually, system problems begin to
occur. Plus, when you try to shut down windows, you get all of these
instances not responding to windows.

It sure sounds like a memory leak, or a failure to dispose a system
resource, such as a non standard color.

But, we've scoured our app and commented out all such Color creations. We
don't do anything with fonts, so we're out of ideas as to what would cause
this problem. We have verified that this problem does not occur with
simplistic apps.

Anyone have any ideas on...?
1. What our problem is
2. Strategies for troubleshooting
Re: javaw.exe keeps running in Windows [message #449361 is a reply to message #449332] Mon, 24 January 2005 17:10 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
The java VM will not keep running if you fail to dispose an SWT resource.
Are you exiting from your event loop?

"Bill Ewing" <ewing@irori.com> wrote in message
news:csrshl$asq$1@www.eclipse.org...
> In Task Manager, you see an instance of javaw.exe (Windows' jvm launcher)
> appear when you start eclipse. We see another instance appear when we run
> our JFace app (either under eclipse or standalone).
>
> After exiting our app, its javaw.exe does not disappear from Task Manager.
> They pile up, one for each run. Eventually, system problems begin to
> occur. Plus, when you try to shut down windows, you get all of these
> instances not responding to windows.
>
> It sure sounds like a memory leak, or a failure to dispose a system
> resource, such as a non standard color.
>
> But, we've scoured our app and commented out all such Color creations. We
> don't do anything with fonts, so we're out of ideas as to what would cause
> this problem. We have verified that this problem does not occur with
> simplistic apps.
>
> Anyone have any ideas on...?
> 1. What our problem is
> 2. Strategies for troubleshooting
>
Re: javaw.exe keeps running in Windows [message #449462 is a reply to message #449361] Mon, 24 January 2005 22:26 Go to previous messageGo to next message
Bill Ewing is currently offline Bill EwingFriend
Messages: 49
Registered: July 2009
Member
Steve Northover wrote:

> The java VM will not keep running if you fail to dispose an SWT resource.
> Are you exiting from your event loop?

> "Bill Ewing" <ewing@irori.com> wrote in message
> news:csrshl$asq$1@www.eclipse.org...
>> In Task Manager, you see an instance of javaw.exe (Windows' jvm launcher)
>> appear when you start eclipse. We see another instance appear when we run
>> our JFace app (either under eclipse or standalone).
>>
>> After exiting our app, its javaw.exe does not disappear from Task Manager.
>> They pile up, one for each run. Eventually, system problems begin to
>> occur. Plus, when you try to shut down windows, you get all of these
>> instances not responding to windows.
>>
>> It sure sounds like a memory leak, or a failure to dispose a system
>> resource, such as a non standard color.
>>
>> But, we've scoured our app and commented out all such Color creations. We
>> don't do anything with fonts, so we're out of ideas as to what would cause
>> this problem. We have verified that this problem does not occur with
>> simplistic apps.
>>
>> Anyone have any ideas on...?
>> 1. What our problem is
>> 2. Strategies for troubleshooting
>>

Thank you for taking the time to post, Steve. The information in your
response is valuable to us.

We are using JFace. Specifically, we have an ApplicationWindow class that
contains a main method. So, I believe handling the event loop is
automatically done by ApplicationWindow-- it's buried and not available
for us to see (until we figure out how to attach source and JavaDoc to
libs we use).

What would you suggest we look at next?

I was in the process of commenting out chunks of the program, piece by
piece until the zombie javaw.exe no longer hangs around in Task Manager.

But now, the knowledge that failure to dispose() would not cause this
problem makes us wonder just what sort of problem we are chasing.

Our main method looks like the following. It was auto-generated by the
GUI builder available from swt-designer.com.

public static void main(String args[]) {
try {
MainWindow window = new MainWindow();
window.setBlockOnOpen(true);
window.open();
} catch (Exception e) {
e.printStackTrace();
}
}
Re: javaw.exe keeps running in Windows [message #449463 is a reply to message #449462] Tue, 25 January 2005 00:32 Go to previous messageGo to next message
Bill Ewing is currently offline Bill EwingFriend
Messages: 49
Registered: July 2009
Member
Bill Ewing wrote:

> Steve Northover wrote:

>> The java VM will not keep running if you fail to dispose an SWT resource.
>> Are you exiting from your event loop?

>> "Bill Ewing" <ewing@irori.com> wrote in message
>> news:csrshl$asq$1@www.eclipse.org...
>>> In Task Manager, you see an instance of javaw.exe (Windows' jvm launcher)
>>> appear when you start eclipse. We see another instance appear when we run
>>> our JFace app (either under eclipse or standalone).
>>>
>>> After exiting our app, its javaw.exe does not disappear from Task Manager.
>>> They pile up, one for each run. Eventually, system problems begin to
>>> occur. Plus, when you try to shut down windows, you get all of these
>>> instances not responding to windows.
>>>
>>> It sure sounds like a memory leak, or a failure to dispose a system
>>> resource, such as a non standard color.
>>>
>>> But, we've scoured our app and commented out all such Color creations. We
>>> don't do anything with fonts, so we're out of ideas as to what would cause
>>> this problem. We have verified that this problem does not occur with
>>> simplistic apps.
>>>
>>> Anyone have any ideas on...?
>>> 1. What our problem is
>>> 2. Strategies for troubleshooting
>>>

> Thank you for taking the time to post, Steve. The information in your
> response is valuable to us.

> We are using JFace. Specifically, we have an ApplicationWindow class that
> contains a main method. So, I believe handling the event loop is
> automatically done by ApplicationWindow-- it's buried and not available
> for us to see (until we figure out how to attach source and JavaDoc to
> libs we use).

> What would you suggest we look at next?

> I was in the process of commenting out chunks of the program, piece by
> piece until the zombie javaw.exe no longer hangs around in Task Manager.

> But now, the knowledge that failure to dispose() would not cause this
> problem makes us wonder just what sort of problem we are chasing.

> Our main method looks like the following. It was auto-generated by the
> GUI builder available from swt-designer.com.

> public static void main(String args[]) {
> try {
> MainWindow window = new MainWindow();
> window.setBlockOnOpen(true);
> window.open();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }


OK, it looks like we were not dispose'ing Display. Thank you Bahram, for
suggesting that earlier.

The reason that this stumped us is that all of the code is autogenerated
by a GUI designer tool that we assumed worked. We've contacted the
manufacturer (who sent us here).

Our new main method now looks like below.

public static void main(String args[]) {
try {
MainWindow window = new MainWindow();
window.setBlockOnOpen(true);
Display.getCurrent().dispose();
} catch (Exception e) {
e.printStackTrace();
}
}
Re: javaw.exe keeps running in Windows [message #449505 is a reply to message #449463] Tue, 25 January 2005 15:08 Go to previous messageGo to next message
Steve Northover is currently offline Steve NorthoverFriend
Messages: 1636
Registered: July 2009
Senior Member
Ok, it was a combination of the GUI builder and JFace. I just want to
confirm with you that SWT doesn't do anything special to keep running.

"Bill Ewing" <ewing@irori.com> wrote in message
news:ct442e$t3m$1@www.eclipse.org...
> Bill Ewing wrote:
>
> > Steve Northover wrote:
>
> >> The java VM will not keep running if you fail to dispose an SWT
resource.
> >> Are you exiting from your event loop?
>
> >> "Bill Ewing" <ewing@irori.com> wrote in message
> >> news:csrshl$asq$1@www.eclipse.org...
> >>> In Task Manager, you see an instance of javaw.exe (Windows' jvm
launcher)
> >>> appear when you start eclipse. We see another instance appear when we
run
> >>> our JFace app (either under eclipse or standalone).
> >>>
> >>> After exiting our app, its javaw.exe does not disappear from Task
Manager.
> >>> They pile up, one for each run. Eventually, system problems begin to
> >>> occur. Plus, when you try to shut down windows, you get all of these
> >>> instances not responding to windows.
> >>>
> >>> It sure sounds like a memory leak, or a failure to dispose a system
> >>> resource, such as a non standard color.
> >>>
> >>> But, we've scoured our app and commented out all such Color creations.
We
> >>> don't do anything with fonts, so we're out of ideas as to what would
cause
> >>> this problem. We have verified that this problem does not occur with
> >>> simplistic apps.
> >>>
> >>> Anyone have any ideas on...?
> >>> 1. What our problem is
> >>> 2. Strategies for troubleshooting
> >>>
>
> > Thank you for taking the time to post, Steve. The information in your
> > response is valuable to us.
>
> > We are using JFace. Specifically, we have an ApplicationWindow class
that
> > contains a main method. So, I believe handling the event loop is
> > automatically done by ApplicationWindow-- it's buried and not available
> > for us to see (until we figure out how to attach source and JavaDoc to
> > libs we use).
>
> > What would you suggest we look at next?
>
> > I was in the process of commenting out chunks of the program, piece by
> > piece until the zombie javaw.exe no longer hangs around in Task Manager.
>
> > But now, the knowledge that failure to dispose() would not cause this
> > problem makes us wonder just what sort of problem we are chasing.
>
> > Our main method looks like the following. It was auto-generated by the
> > GUI builder available from swt-designer.com.
>
> > public static void main(String args[]) {
> > try {
> > MainWindow window = new MainWindow();
> > window.setBlockOnOpen(true);
> > window.open();
> > } catch (Exception e) {
> > e.printStackTrace();
> > }
> > }
>
>
> OK, it looks like we were not dispose'ing Display. Thank you Bahram, for
> suggesting that earlier.
>
> The reason that this stumped us is that all of the code is autogenerated
> by a GUI designer tool that we assumed worked. We've contacted the
> manufacturer (who sent us here).
>
> Our new main method now looks like below.
>
> public static void main(String args[]) {
> try {
> MainWindow window = new MainWindow();
> window.setBlockOnOpen(true);
> Display.getCurrent().dispose();
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
>
Re: javaw.exe keeps running in Windows [message #449588 is a reply to message #449505] Wed, 26 January 2005 18:20 Go to previous message
Bill Ewing is currently offline Bill EwingFriend
Messages: 49
Registered: July 2009
Member
Hi Steve. Yes, confirmed. Our problem was a combination of JFace and a
GUI designer which is now fixed. To summarize, main method was missing
"Display.getCurrent().dispose()" below:

public static void main(String args[]) {
try {
MainWindow window = new MainWindow();
// (MainWindow is an ApplicationWindow)
window.setBlockOnOpen(true);
Display.getCurrent().dispose();
} catch (Exception e) {
e.printStackTrace();
}
}





Steve Northover wrote:

> Ok, it was a combination of the GUI builder and JFace. I just want to
> confirm with you that SWT doesn't do anything special to keep running.

> "Bill Ewing" <ewing@irori.com> wrote in message
> news:ct442e$t3m$1@www.eclipse.org...
>> Bill Ewing wrote:
>>
>> > Steve Northover wrote:
>>
>> >> The java VM will not keep running if you fail to dispose an SWT
> resource.
>> >> Are you exiting from your event loop?
>>
>> >> "Bill Ewing" <ewing@irori.com> wrote in message
>> >> news:csrshl$asq$1@www.eclipse.org...
>> >>> In Task Manager, you see an instance of javaw.exe (Windows' jvm
> launcher)
>> >>> appear when you start eclipse. We see another instance appear when we
> run
>> >>> our JFace app (either under eclipse or standalone).
>> >>>
>> >>> After exiting our app, its javaw.exe does not disappear from Task
> Manager.
>> >>> They pile up, one for each run. Eventually, system problems begin to
>> >>> occur. Plus, when you try to shut down windows, you get all of these
>> >>> instances not responding to windows.
>> >>>
>> >>> It sure sounds like a memory leak, or a failure to dispose a system
>> >>> resource, such as a non standard color.
>> >>>
>> >>> But, we've scoured our app and commented out all such Color creations.
> We
>> >>> don't do anything with fonts, so we're out of ideas as to what would
> cause
>> >>> this problem. We have verified that this problem does not occur with
>> >>> simplistic apps.
>> >>>
>> >>> Anyone have any ideas on...?
>> >>> 1. What our problem is
>> >>> 2. Strategies for troubleshooting
>> >>>
>>
>> > Thank you for taking the time to post, Steve. The information in your
>> > response is valuable to us.
>>
>> > We are using JFace. Specifically, we have an ApplicationWindow class
> that
>> > contains a main method. So, I believe handling the event loop is
>> > automatically done by ApplicationWindow-- it's buried and not available
>> > for us to see (until we figure out how to attach source and JavaDoc to
>> > libs we use).
>>
>> > What would you suggest we look at next?
>>
>> > I was in the process of commenting out chunks of the program, piece by
>> > piece until the zombie javaw.exe no longer hangs around in Task Manager.
>>
>> > But now, the knowledge that failure to dispose() would not cause this
>> > problem makes us wonder just what sort of problem we are chasing.
>>
>> > Our main method looks like the following. It was auto-generated by the
>> > GUI builder available from swt-designer.com.
>>
>> > public static void main(String args[]) {
>> > try {
>> > MainWindow window = new MainWindow();
>> > window.setBlockOnOpen(true);
>> > window.open();
>> > } catch (Exception e) {
>> > e.printStackTrace();
>> > }
>> > }
>>
>>
>> OK, it looks like we were not dispose'ing Display. Thank you Bahram, for
>> suggesting that earlier.
>>
>> The reason that this stumped us is that all of the code is autogenerated
>> by a GUI designer tool that we assumed worked. We've contacted the
>> manufacturer (who sent us here).
>>
>> Our new main method now looks like below.
>>
>> public static void main(String args[]) {
>> try {
>> MainWindow window = new MainWindow();
>> window.setBlockOnOpen(true);
>> Display.getCurrent().dispose();
>> } catch (Exception e) {
>> e.printStackTrace();
>> }
>> }
>>
Previous Topic:More than on curser and selections
Next Topic:Outlook Address Book
Goto Forum:
  


Current Time: Fri Nov 15 20:15:09 GMT 2019

Powered by FUDForum. Page generated in 0.02962 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top