Re: [JAVA3D] Memory handling

2001-07-23 Thread Pasi Paasiala
: [JAVA3D] Memory handling Oops, Also, to truly override finalize of the Java native classes, finalize must be declared protected, not private as I formerly stated or public as in Karsten's code. thanks for the correction. Lazyness is always awkward. protected void finalize() throws

Re: [JAVA3D] Memory handling

2001-07-17 Thread Karsten Fries
Oops, Also, to truly override finalize of the Java native classes, finalize must be declared protected, not private as I formerly stated or public as in Karsten's code. thanks for the correction. Lazyness is always awkward. protected void finalize() throws Throwable { // your code /

Re: [JAVA3D] Memory handling

2001-07-16 Thread Christopher Collins
(). 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

Re: [JAVA3D] Memory handling

2001-07-16 Thread Greg Munt
: Christopher Collins [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Monday, July 16, 2001 01:34 Subject: Re: [JAVA3D] Memory handling [snip] You can force the garbage collection somewhat by calling System.gc

Re: [JAVA3D] Memory handling

2001-07-16 Thread Justin Couch
Greg Munt wrote: System.gc is not guaranteed to do ANYTHING. Yes it is. It is guaranteed that the VM will make its best efforts to reduce the amount of currently allocated memory that has no references to it. If it has no free references to collect, then it will not appear to do anything, but

Re: [JAVA3D] Memory handling

2001-07-16 Thread Christopher Collins
System.gc() is effectively equivalent to the call: Runtime.getRuntime().gc() -Original Message- From: Greg Munt [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 10:39 AM To: [EMAIL PROTECTED] Subject: Re: [JAVA3D] Memory handling This is just not true. Garbage collection is never

Re: [JAVA3D] Memory handling

2001-07-16 Thread Karsten Fries
Oouch, private void finalize() { System.out.println(BranchGroup finalized); } this is definitely not the way to do it. This is a AntiPattern in Java!!! When overriding finalize make sure you use this construct public void finalize() java.lang.Throwable { // this is very

Re: [JAVA3D] Memory handling

2001-07-16 Thread Christopher Collins
Oops! Big mistake! Of course if I had actually referred to my working code, I would have recalled the super.finalize() call and the throwable declaration... Any text or FAQ can explain finalize and it's use more clearly. Sorry for my mistake! However, I think the following would be better

[JAVA3D] Memory handling

2001-07-13 Thread Lan Wu-Cavener
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