Hi All!
My task is to render some independent scenes one-by-one.
At one moment I need only one Canvas3D.
Now I use such scheme:
====
...
SimpleUniverse universe;
List geometries = new ArrayList();
public void reset() {
geometries = new ArrayList();
universe.removeAllLocales();
universe = null;
scenePanel.removeAll();
}
public void update() {
final GraphicsConfiguration graphicsConfiguration =
SimpleUniverse.getPreferredConfiguration();
final Canvas3D canvas3D = new Canvas3D(graphicsConfiguration);
OrbitBehavior orbit = new OrbitBehavior(canvas3D,
OrbitBehavior.REVERSE_ALL);
Bounds bounds = new BoundingBox(new Point3d(-100, -100, -100),
new Point3d(100, 100, 100));
orbit.setSchedulingBounds(bounds);
ViewingPlatform viewingPlatform = universe.getViewingPlatform();
viewingPlatform.setNominalViewingTransform();
viewingPlatform.setViewPlatformBehavior(orbit);
BranchGroup scene = createScene(geometries);
Background background = new Background(new
Color3f(sceneBackground));
background.setApplicationBounds(bounds);
scene.addChild(background);
universe = new SimpleUniverse(canvas3D);
universe.addBranchGraph(scene);
scenePanel.removeAll();
scenePanel.add(canvas3D, BorderLayout.CENTER);
scenePanel.revalidate();
}
...
====
But memory leaks!
It seems that _ALL_ consumed memory isn't freed.
2 scenes rendering (create 1st scene, remove it, then create 2nd scene)
requires TWICE(!) more memory.
3 scenes rendering takes 3x more memory and so on.
What's the problem?
Where is lost implicit reference?
--
Stanislav Mironov
===========================================================================
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".