Enable caching of NODES that were loaded via 'readNode'#4
Open
AdriCS wants to merge 3 commits into
Open
Conversation
The new method adds a new hint in the *Database Registry* cache, to let caching of more objects. By default, the *Registry* only caches **ARCHIVES** node types. I had encounter an issue with the PagedLOD and the point clouds. For example, imagine a point cloud from a town road. If I set an AnimationPath that simulates that road and move the cloud alongside, with a high zoom level (i.e.: close to the cloud) several LODs will be loaded. When reaching the end of the path and going back to the first spot, if the path is re-run, the LODs are still in memory but OSG won't recognize them so they will be loaded again, consuming more memory. Of course, setting the max LOD target in the Database Pager to a low number also helps.
It is called in the constructors with a *CACHE_NODES* parameter that it's added to the default parameter in the Options (CACHE_ARCHIVES). This will let the caching of the model LOD nodes. With the standard LOD target in the DatabasePager (300) I scarcely found any gain. I set it to a very low value (for example, 10) and my memory consuption stopped to increase while playing with the cloud. This worked for me, but maybe a better/more elaborate solution will be helpful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It's added to the Database Registry cache a hint to allow the caching of the nodes loaded from the OutOfCore Octree, instead of re-loading them every time they're needed.
My memory comsuption was reduced using this trick.