Garbage collect Canvas3D???

I am using a Canvas3D (Java3D) to display the map
in my game. This works fine, however, I am unable to
garbage collect the Canvas3D or World BranchGroup
completly.

The game uses about 120MB for the display of the
map including objects. If I try to clean up the 3D
canvas, I only get back 60MB. 60MB is still used
somewhere?

That’s the code I use:


    // stop 3D renderer
    canvas3D.stopRenderer();   
    // cleanup world bg (detach from simpleUniverse)
    worldBG.detach();
    worldBG = null;    
    // cleanup simple universe
    simpleUniverse.removeAllLocales();
    simpleUniverse.cleanup();
    simpleUniverse = null;

The example above just tries to garbage collect the
worldBG, but as said before only 60MB out of 120MB
are being garbage collected.

What’s wrong? What’s the proper way to
a) garbage collect a branch group
-OR-
b) a canvas3D

I solved it! For the 3DS and OBJ loaders that I used,
I only instantiated them once, and used them over and
over to load 3DS and OBJ files. It seems like these
loaders keep a reference to the loaded scenes and
in turn prevent most of my BranchGroup not to be garbage collected.

Now, they get instantiated every time I want to load
a model from a file and garbage collection seems to
work just fine!