Hi,

I was having memory issues with my OSG scene.  I was calling removeChild() but 
didn't appear to be getting my memory back.  In my application, I frequently 
add and remove large texture mapped geometries.  In particular, after one 
operation I might remove about 125 geometries with 30000 vertices and a similar 
number of TRIANGLES, and replace them with new ones.  I was running out of 
memory when doing this, even though I can easily add more than 300 such objects 
from scratch.

My solution was 


Code:
_gw = new osgViewer::GraphicsWindowEmbedded(...);
osg::DeleteHandler* dh = new osg::DeleteHandler;
_gw->setDeleteHandler(dh);

// ... later after adding and removing objects...
dh->flush()




First, is this a standard way to force objects to be deleted?  Second, is there 
a better way?  Third, hopefully this will be useful to someone in the future 
faced with the same issue.

Cheers,
Doug

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42266#42266





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to