Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable caching of NODES that were loaded via 'readNode' #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AdriCS
Copy link

@AdriCS AdriCS commented Oct 2, 2014

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.

AdriCS added 3 commits October 2, 2014 16:23
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant