It seems Java 3D memory never get released. I modify
the HelloUniverse sample program to add a "for" loop
to create scene and SimpleUniverse. The program get
out of memory exception. I am running on NT4.0 with
256M byte of RAM on Jdk1.2.2 and J3d 1.13 release.
I did not use -Xmx options to increase heap size.
The program calls runtime.freeMemory, runtime.totalMemory and System.gc
to force garbage collection inside the "for" loop. I can see
the free memory increases after the program calls system.gc. But the
runtime.totalMemory keeps increasing until the program
runs out of memory.
I don't understand why the totalMemory keep increasing,
because the program just creates some objects and release them
inside the "for" loop so the garbage collector should free
these memory and the program can re-use the memory after that.
Does any one have the same "memory leak" problem
in using 3D? I have attached a copy of modified program
for HelloUniverse. Thanks in advance for any help.
Ching
HelloUniverse.java