Skip to main content

JDialog, dispose and removeAllLocales

4 replies [Last post]
pauldb
Offline
Joined: 2003-08-30
Points: 0

Hi,
I have a Java3D canvas in a dialog. I can hide the dialog but if I try to dispose of it, my machine hangs.

I can do a removeAll() to get rid of the components in the dialog (including the Canvas3D) before calling dispose(). That seems to get things a little further but then I get the "Send Error to Microsoft" message (I'm running on XP).

I've tried the call to dispose before and after calling removeAllLocales on the Universe object.

I would be grateful for any explanation of this and any advice on how to workaround it.

A related question:
What are the ramifications of not calling removeAllLocales in an application that creates and disposes (hopefully) several dialogs - each with a Java3D scene - several times over? Will I run out of system resources? Memory?

Thanks,
-Paul

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kcr
Offline
Joined: 2004-03-17
Points: 0

> Hi,
> I have a Java3D canvas in a dialog. I can hide the
> dialog but if I try to dispose of it, my machine
> hangs.

Please submit an Issue at https://java3d.dev.java.net/servlets/ProjectIssues along with a test case.

> A related question:
> What are the ramifications of not calling
> removeAllLocales in an application that creates and
> disposes (hopefully) several dialogs - each with a
> Java3D scene - several times over? Will I run out of
> system resources? Memory?

If you are creating a new Universe or a new View each time, then yes, you will eventually run out of memory if you don't call removeAllLocales. The Java 3D runtime system creates threads that will keep references to active scene graphs and views.

If you are using SimpleUniverse, then you should call the SimpleUniverse.cleanup() method to dispose of resources (cleanup calls removeAllLocales so you don't need to call it again). If you are not using SimpleUniverse, then you should call View.removeAllCanvas3Ds(), View.attachViewPlatform(null), and VirtualUniverse.removeAllLocales();

-- Kevin

pauldb
Offline
Joined: 2003-08-30
Points: 0

Thanks Kevin.

The advice on cleaning up Java3D should be posted somewhere prominent. Perhaps the tutorials need to be updated to version 1.3.

As for the problem with my dialog. It does not occur when I run with J2SE 1.5/5.0 beta 2.

Thanks,
-Paul

Mike Pilone

Paul,

Just a guess, but your 'Send Error to Microsoft' could be related to bug 5:
https://java3d.dev.java.net/issues/show_bug.cgi?id=5. This would depend on
if you are using an nvidia card. I haven't gotten the MS dialog, but I run
from the command line so I am not sure if windows would detect the crash.

In theory I would think that just releasing the reference to the universe
should allow Java to reclaim it, however I seem to remember some discussions
on the old list that due to the circular references in J3D things do not
always get cleaned up. I would do some searching on the old archives about
it.

-mike

-----Original Message-----
From: java3d-interest@javadesktop.org
[mailto:java3d-interest@javadesktop.org]
Sent: Tuesday, July 27, 2004 10:33 AM
To: interest@java3d.dev.java.net
Subject: [JAVA3D-INTEREST] JDialog, dispose and removeAllLocales

Hi,
I have a Java3D canvas in a dialog. I can hide the dialog but if I try to
dispose of it, my machine hangs.

I can do a removeAll() to get rid of the components in the dialog (including
the Canvas3D) before calling dispose(). That seems to get things a little
further but then I get the "Send Error to Microsoft" message (I'm running on
XP).

I've tried the call to dispose before and after calling removeAllLocales on
the Universe object.

I would be grateful for any explanation of this and any advice on how to
workaround it.

A related question:
What are the ramifications of not calling removeAllLocales in an application
that creates and disposes (hopefully) several dialogs - each with a Java3D
scene - several times over? Will I run out of system resources? Memory?

Thanks,
-Paul
---
[Message sent by forum member 'pauldb' (Paul Brown)]

http://www.javadesktop.org/forums/thread.jspa?messageID=19534&#19534

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

pauldb
Offline
Joined: 2003-08-30
Points: 0

I do have an NVidia card but I'm running Java3D 1.3.1 not the new version 1.3.2.

-Paul