On 8/26/2011 11:18 AM, David Benoit wrote:
Hi,
I was having memory issues with my OSG scene. I was calling removeChild() but
didn't appear to be getting my memory back.
When you call removeChild(), Referenced::unref() should get called. You should
be able to set a breakpoint there to see whether the reference count dropped to
zero (I suspect it didn't, indicating the memory was either referenced by
another ref_ptr somewhere, or you had explicitly called ref() ).
Also note that some memory management systems don't free memory back to the
system, they free it back to the process. If memory is being freed to the
process, process size doesn't shrink when memory is deallocated. This is not an
OSG issue, but I mention it here because your post doesn't say how you reached
the conclusion that your app was leaking memory.
There have been countless threads discussing OSG memory usage in this mailing
list over the years. I imagine a good search of the archives might shed some
light on the issue you encountered.
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org