Rewrote the DatabasePager::removeExpiredSubgraphs(double) routine as it

as not expiring subgraphs quick enough to enable reasonable load balancing.

New version isn't perfect and will need further work, but does at least reduce
the memory footprint by as much as half on test paths on big databases.

The rewritten method no longer uses the the MaximumNumOfRemovedChildPagedLODs
and MinimumNumOfInactivePagedLODs variables so these and associated methods
for accessing them have been removed.

-        /** 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; }
This commit is contained in:
Robert Osfield
2008-03-28 15:52:10 +00:00
parent 3f81a994b7
commit c1e32ef742
2 changed files with 75 additions and 172 deletions

View File

@@ -251,18 +251,6 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
/** Reset the Stats variables.*/
void resetStats();
/** 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; }
typedef std::list< osg::ref_ptr<osg::PagedLOD> > PagedLODList;
typedef std::set< osg::ref_ptr<osg::StateSet> > StateSetList;
typedef std::vector< osg::ref_ptr<osg::Drawable> > DrawableList;
@@ -310,6 +298,8 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
class FindCompileableGLObjectsVisitor;
friend class FindCompileableGLObjectsVisitor;
class MarkPagedLODsVisitor;
class FindPagedLODsVisitor;
friend class FindPagedLODsVisitor;
@@ -444,9 +434,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
DatabaseRequestList _dataToMergeList;
mutable OpenThreads::Mutex _dataToMergeListMutex;
PagedLODList _activePagedLODList;
PagedLODList _inactivePagedLODList;
PagedLODList _pagedLODList;
double _expiryDelay;
@@ -457,8 +445,6 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
double _targetFrameRate;
double _minimumTimeAvailableForGLCompileAndDeletePerFrame;
unsigned int _maximumNumOfObjectsToCompilePerFrame;
unsigned int _maximumNumOfRemovedChildPagedLODs;
unsigned int _minimumNumOfInactivePagedLODs;
double _minimumTimeToMergeTile;
double _maximumTimeToMergeTile;