Sorry. I was not clear about exactly what my problem was. It was not a memory leak. I was running out of memory because the OSG garbage collector was not freeing memory right away. It would eventually free memory if I waited long enough, but I needed a way to force it to free the memory immediately.
In my code, if I added some sleep() calls, I could see (on Ubuntu) memory usage rise and fall as expected. If I removed those sleep() calls, but left everything else the same, memory usage would not fall and I would run out of memory. My solution was to use DeleteHandler::flush() after removeChild() as well as making sure my object have been rendered to the screen. (I suspect the refCount won't be zero until after an object has actually been drawn, but I didn't verify this.) I would be interested to hear from anyone else who has had to worry about the details of the garbage collector. Thanks! ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42306#42306 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

