[osg-users] Unbounded growth in OpenFlight ReaderWriter

Robert Osfield robert.osfield at gmail.com
Tue Jul 31 03:56:40 PDT 2018


Hi Dan,

I'm not at a point where I can easily switch over to thinking about
OSG code written by others so rather than jump it right now I'll ask a
simple question that might help point you in a direction worthy of
investigation.

FYI, I'm not the author of the OpenFlight plugin so am in the same
boat as yourself when it comes to working out what it does, what is
intended, what might be a bug etc.  Each time I'm called in to fix
something in this plugin I learn a bit more... but still lots more to
learn.

I don't personally recall working with a flt::Registry::instance()
local cache so it's a new bit of OpenFlight plugin to me.  I'm a bit
surprised it's there as osgDB has it's own object cache, so I'd wonder
what the motivation was behind the local cache and whether it's really
necessary.  Could it be rewritten to use the osgDB's object cache?

Robert.







On Tue, 31 Jul 2018 at 11:19, Daniel Emminizer, Code 5773
<dan.emminizer at nrl.navy.mil> wrote:
>
> Hello All,
>
> I've found what appears to be unbounded growth in the OpenFlight loader.  I have a work-around but wanted to run it past the community since there are many here who are more familiar with the format and the loader than me.
>
> I'm seeing uncontrolled memory growth when using the std::istream version of readNode.  It appears to populate the local cache with new images, but never clears out the local cache.  The filename-based version of readNode() does clear out the cache before it returns.
>
> Does it make sense to add in:
>
>         flt::Registry::instance()->clearLocalCache();
>
> ... before the return of the ReadResult at the bottom of this method at https://github.com/openscenegraph/OpenSceneGraph/blob/master/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp#L533 ?
>
>
> If that's not a good path forward, do you have any suggestions on how to clear the cache on demand?
>
> Thanks,
>
>  - Dan
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


More information about the osg-users mailing list