You can try a trial version of the program "OptimizeIt", which will
allow you to track the number of instances of each type of object while
your program is running, and the amount of memory they take up.  This
program helped me out a lot last week.  Just search for OptimizeIt on
any shareware site.  Another way to ensure that your BranchGroups are
being disposed is to make them into a class which extends BranchGroup
and then create a method such as:

private void finalize() {
        System.out.println("BranchGroup finalized");
} 

The "finalize" method, if present, is called by the GarbageCollector
when it is ready to free up memory held by an old unused object.  It is
guaranteed to run before the memory is freed.  If you don't see that
message appear on your output stream, then your BranchGroups are still
present.

You can force the garbage collection somewhat by calling System.gc().

Christopher

-----Original Message-----
From: Lan Wu-Cavener [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 5:38 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Memory handling


I am running into this "java.lang.OutOfMemoryError (no trace stack
available)" problem when my program detach some BranchGroup objects, and
re-generate them as the user navigates through the graphic scene. The
regenerated BranchGroup objects are not any larger than its previous
counterparts, but they do need quite a bit calculation to generate. My
question is: How do I verify the detached BranchGroup objects are
released
from memory?

If any one can give me some help, I would appreciate it very much.
Lan

Lan Wu-Cavener
Research Associate and Programmer
Dept. of Landscape Architecture

========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA3D-INTEREST".  For general help, send email
to
[EMAIL PROTECTED] and include in the body of the message "help".

==========================================================================To 
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to