Hi Pagees,

I've been looking into the problem of memory growth in the new rev of
the DatabasePager and I've tracked the problem down to the new
mechanism of attached DatabaseRequest's via a ref_ptr<> to
PagedLOD/ProxyNode nodes.  The DatabaseRequest themselves had a
ref_ptr<> which creates a circular reference.

Normally the DatabasePager manually breaks the circular reference
during its normal operations, so most of the time no leak occurs.
However, if the view is moving quickly then old tiles will get expired
and removed from the scene graph, and if these tiles have had a
previous file request made for them then the circular reference is
never broken and leak occurs.

The solution was to introduce an observer_ptr<> into DatabaseRequest
instead of a ref_ptr<>.  This change has meant that the code that
relies on this pointer now has to be more careful as it now has to
handle instances where the pointer becomes null, but this is small
addition that is easy to add.

I'm currently testing the new code thoroughly, and will clean it up
and check it in next half an hour.  This means that this fix will make
it into the 2.5.1 dev release that'll I'll make this afternoon.

Robert.

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

Reply via email to