Thanks Robert, no circular reference since I am displaying that database in the viewer nicely. Here is the struct (a bit odd but it is as is):
Group | PagedLOD PagedLOD PagedLOD .... dozen of these | Quadtree (similar to VPB generated subtiles) I was thinking the visitor is reading all of these by reading all of these PagedLODs without taking the account the range from the eyepoint. So while debuging I tried this: struct MyIntersectionVisitor : public osgUtil::IntersectionVisitor { MyIntersectionVisitor(float range) : IntersectionVisitor() , _range(range) { } virtual void apply(osg::PagedLOD& plod) { if (getDistanceFromEyePoint(plod.getCenter(), true) < _range) { osgUtil::IntersectionVisitor::apply(plod); } } protected: float _range; }; but no luck. Is there a way to flush all the pending and loaded nodes from the DatabasePager? On Tue, Jan 9, 2018 at 1:23 PM, Robert Osfield <robert.osfi...@gmail.com> wrote: > Hi Nick, > > This is really something you'd want to use a debug for - just run it > and break the app before anything untoward happens. > > The code itself looks quite benign on a first reading, the only thing > I can think of that might cause a memory issue would be if your scene > graph had a circular reference in it so the traversal ends up in an > infinite loop. > > Robert > > On 9 January 2018 at 12:12, Trajce Nikolov NICK > <trajce.nikolov.n...@gmail.com> wrote: > > hi Robert, Community, > > > > I have the following code in a loop against very large quadtree based > > database. And this code is eating all the memory, progressively and then > the > > system kills it . Any clue? > > > > Thanks a lot > > > > osg::ref_ptr<osgUtil::LineSegmentIntersector> picker; > > osg::ref_ptr<osgUtil::IntersectionVisitor> iv; > > > > osg::Vec3d getHOT(const osg::Vec3d& position, osgViewer::CompositeViewer& > > viewer, osg::Vec3& normal, bool& valid) > > { > > osg::Vec3d result; > > > > osg::EllipsoidModel em; > > osg::Vec3d up = em.computeLocalUpVector(position.x(), position.y(), > > position.z()); > > up.normalize(); > > > > osg::Vec3d s = position + up * 100; > > osg::Vec3d e = osg::Vec3d(0, 0, 0); > > > > if (viewer.getView(0)->getSceneData()) > > { > > #if 1 > > if (!picker.valid()) > > { > > picker = new osgUtil::LineSegmentIntersector(s,e); > > iv = new MyIntersectionVisitor(RANGE); > > } > > picker->setStart(s); > > picker->setEnd(e); > > picker->getIntersections().clear(); > > iv->setIntersector(picker); > > iv->reset(); > > iv->setUseKdTreeWhenAvailable(false); > > //iv->setLODSelectionMode(osgUtil::IntersectionVisitor:: > USE_EYE_POINT_FOR_LOD_LEVEL_SELECTION); > > viewer.getView(0)->getSceneData()->accept(*iv); > > > > if (picker->containsIntersections()) > > { > > osgUtil::LineSegmentIntersector::Intersections hitList = > > picker->getIntersections(); > > osgUtil::LineSegmentIntersector::Intersections::iterator hit = > > hitList.begin(); > > > > result = hit->getWorldIntersectPoint(); > > normal = hit->getWorldIntersectNormal(); > > valid = true; > > > > return result; > > } > > #endif > > } > > valid = false; > > > > return result; > > } > > > > -- > > trajce nikolov nick > > > > _______________________________________________ > > osg-users mailing list > > osg-users@lists.openscenegraph.org > > http://lists.openscenegraph.org/listinfo.cgi/osg-users- > openscenegraph.org > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > -- trajce nikolov nick
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org