[osg-users] Databasepager + multiple views + different camera positions = memory leak?
Michael Bach Jensen
michael at ifad.dk
Thu Nov 5 04:52:48 PST 2009
Hi,
I don't know if this helps any, but as I mentioned earlier, I think I remembered one of the PagedLOD lists in the pager started to grow rapidly. I now have confirmation of this. I modified Sergey's example with the following pager of my own:
Code:
class MyPager : public osgDB::DatabasePager
{
public:
virtual void updateSceneGraph(const osg::FrameStamp& frameStamp)
{
if (frameStamp.getFrameNumber() % 60 == 0)
{
osg::Timer_t start = osg::Timer::instance()->tick();
osgDB::DatabasePager::updateSceneGraph(frameStamp);
double d = osg::Timer::instance()->delta_m(start, osg::Timer::instance()->tick());
std::cout << "DatabasePager update took " << d << " ms. Length of active nodes = " << _activePagedLODList.size() << std::endl;
}
}
};
I of course tell the 3 views to use (the same) instance of this pager instead of the default one. When running this modified version, I get the following (edited) output. For the full output - see attachment.
>
> DatabasePager update took 0.0138043 ms. Length of active nodes = 0
> DatabasePager update took 0.00997741 ms. Length of active nodes = 0
> DatabasePager update took 0.0093426 ms. Length of active nodes = 0
> DatabasePager update took 0.0104595 ms. Length of active nodes = 0
> ...snip...
> DatabasePager update took 0.0985764 ms. Length of active nodes = 432
> DatabasePager update took 0.0910394 ms. Length of active nodes = 432
> DatabasePager update took 0.762089 ms. Length of active nodes = 344
> DatabasePager update took 0.140648 ms. Length of active nodes = 340
> DatabasePager update took 0.343676 ms. Length of active nodes = 355
> ...snip...
> DatabasePager update took 3.88591 ms. Length of active nodes = 8703
> DatabasePager update took 3.95381 ms. Length of active nodes = 8943
> DatabasePager update took 3.93229 ms. Length of active nodes = 9183
> DatabasePager update took 3.99049 ms. Length of active nodes = 9423
> DatabasePager update took 4.04823 ms. Length of active nodes = 9663
> DatabasePager update took 4.05915 ms. Length of active nodes = 9903
> DatabasePager update took 4.05817 ms. Length of active nodes = 10143
> DatabasePager update took 3.99075 ms. Length of active nodes = 10383
> txp::TXPParser::parseScene(): exception thrown in the osg::Optimizer
>
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
>
The crash occured when the app ran out of memory (~2GB on my 32-bit Windows box).
Cheers,
Michael
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19229#19229
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: output.txt
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20091105/523a132d/attachment.txt>
More information about the osg-users
mailing list