Problems with releasing memory

Have jReality programming problems or questions? Post them here.
STRESS
Posts: 141
Joined: Mon 19. Jan 2009, 12:10

Re: Problems with releasing memory

Post by STRESS » Fri 18. Sep 2009, 10:22

Sorry for the unclear formulation. Well I am running an Eclipse RCP application. In RCP Applications the docking windows or tabs you see are either Views or Editors. So when I close the View that has inside of it's composite a jReality frame with an viewerApp and even when I call viewerApp.dispose() in my ViewPart dispose() I still end up loosing 10-15MByte each time I open the View again and close it even if the viewerApp just contains some empty SceneGraphComponent nodes when the underlying viewer is softviewer. I managed to cut it down to ~1.5MByte by doing some of the things Joe suggested. I am using the

prepareMemoryCleanUp(SceneGraphComponent sceneGraphComponent) and it's cleanUp viewer code as well.

I think I can probably live with that for the moment.

User avatar
steffen
Posts: 186
Joined: Fri 16. Jun 2006, 13:30
Location: TU Berlin
Contact:

Re: Problems with releasing memory

Post by steffen » Fri 18. Sep 2009, 11:10

Instead of this prepareMemoryCleanup i suggest you add

Code: Select all

for (Viewer v : viewers) {
	v.setSceneRoot(null);
	v.setCameraPath(null);
	v.setAuxiliaryRoot(null);
}
viewers=null;
to the ViewerApp.dispose method. Maybe you have to wrap the v.set... calls into a try-catch block.

STRESS
Posts: 141
Joined: Mon 19. Jan 2009, 12:10

Re: Problems with releasing memory

Post by STRESS » Fri 18. Sep 2009, 13:08

Thanks Steffen, that has the same effect.

Post Reply