[osg-users] Unbounded growth in OpenFlight ReaderWriter
Robert Osfield
robert.osfield at gmail.com
Tue Jul 31 09:00:10 PDT 2018
Hi Dan,
Changes looks good to me, just merged. Nice to see a bug fix/feature
improvement that removes three times as much code as it adds! :-)
Cheers,
Robert.
On Tue, 31 Jul 2018 at 16:48, Daniel Emminizer, Code 5773
<dan.emminizer at nrl.navy.mil> wrote:
>
> Hi Chris,
>
>
>
> I think that would be good. I have some modifications following Robert’s advice and after more testing I will be posting a PR. Yes, all of the object caching in OpenFlight plugin is the original code from Brede. It all dates back to 2006.
>
>
>
> I was able to swap to use osgDB::Registry’s object cache with no complications on my end. I also got to learn more about the object caching system and how it clears out old values. Thanks Robert for the suggestion to look in this direction.
>
>
>
> I ended up posting a PR at https://github.com/openscenegraph/OpenSceneGraph/pull/583 - It’s low priority since it’s a 12 year old issue, and because it takes a lot of work to get large enough images to crash an app from the problem on modern systems.
>
>
>
> Thanks,
>
>
>
> - Dan
>
>
>
>
>
>
>
> From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Chris Hanson
> Sent: Tuesday, July 31, 2018 10:40 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] Unbounded growth in OpenFlight ReaderWriter
>
>
>
> I think Brede Johansson wrote that loader once upon a time. I'm hoping to connect with him in Oslo this week. Maybe I'll ask him about this if I do.
>
>
>
> On Tue, Jul 31, 2018 at 11:54 AM 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
>
>
>
>
> --
>
> Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com http://www.alphapixel.com/
>
> Training • Consulting • Contracting
>
> 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
>
> Legal/IP • Forensics • Imaging • UAVs • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile • iPhone/iPad/iOS • Android
>
> @alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]
>
> _______________________________________________
> 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