Hi All,

Testing that I've been carrying out on some new big terrain databases
has shown some real weaknesses in the DatabasePager ability to load
balance - with memory footprint growing significantly when the camera
moves fast over wide areas of high res data.  Memory usage was growing
to over 4GB and blowing our test computers, hardly something that is
desired for a database paging system that is supposed to maintain a
modest memory footprint.

After much investigation the cause of the rather unconstrained memory
usage has been traced to the slow speed that the DatabasePager was
expiring (removing) no longer visible subgraphs - subgraphs were
correctly ear marked for removal but idsyncrosies in the threading and
original DatabasePager::removeExpiredSubgraphs(..) method meant that
it would take many frames to finally let go expired subgraphs.  It in
fact was taking long enough that new data was coming in at a far
faster rate than it was been removed at hence the dramatic growth in
memory footprint.

The solution has been to rewrite
theDatabasePager::removeExpiredSubgraphs(..) method that is
responsible for expiring subgraph and setting them aside for deletion.
 I've now got this new implementation working and sees a memory
footprint halved which not affecting the visual quality on screen.
Performance is now much more stable and crashes due to excessive
memory consumption are gone on my test machine.  With this rewrite a
couple member variables and their associated set/getters are no longer
required, and rather leave them around for potential confusion I've
removed them completely so an svn update if you get an compile error
just remove the below methods and recompile.

-        /** Set the maximum number of PagedLOD child to remove per frame */
-        void setMaximumNumOfRemovedChildPagedLODs(unsigned int
number) { _maximumNumOfRemovedChildPagedLODs = number; }
-
-        /** Get the maximum number of PagedLOD child to remove per frame */
-        unsigned int getMaximumNumOfRemovedChildPagedLODs() const {
return _maximumNumOfRemovedChildPagedLODs; }
-
-        /** Set the minimum number of inactive PagedLOD child to keep */
-        void setMinimumNumOfInactivePagedLODs(unsigned int number) {
_minimumNumOfInactivePagedLODs = number; }
-
-        /** Get the minimum number of inactive PagedLOD child to keep */
-        unsigned int getMinimumNumOfInactivePagedLODs() const {
return _minimumNumOfInactivePagedLODs; }

I would like to improve this method further still as I've already come
up with a better load balancing algorithm to implement in this method,
however, it'll take a while longer to implement, so rather than wait
for this polished implementation I'm checking in what is working
effectively, albeit not perfect it is far better than what was there
before.

There are other aspects of the DatabasePager that need attention too,
such as the high cost of DatabasePager::requestNodeFile() method
during cull traversal when many file requested are queued up.  This is
something that has been raised on the list before by others, so it's a
bit of common theme when we really start to push the size of paged
databases we are dealing with.   I will be spending more time on this
code over the coming month, so feel free to chip in with your own
experiences.

Cheers,
Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to