Hello Ramy,
I am asking why, because my application during loading now crashes because its exceeding 2GB of memory under 32bits.. If i remove a part of the scene (to make it less than 2GB in memory load), the scene gets loaded, I can see it in the Task Manager going up to 2GB (or just less) and then decreasing almost to half of its size just before rendering.
Well, OSG has to keep most data in memory to be able to do its work (it has to traverse the scene at runtime to do culling and rendering).
What you're seeing when the memory usage goes down by almost half the initial size just before rendering, is probably the result of the osg::Texture class's unRefImageAfterApply setting. This is not enabled by default, but the osgUtil::Optimizer with certain settings will enable it. What it does is that once the image data for textures is uploaded to the graphics card, it will be deleted from main memory as it's not needed anymore.
But most other data is still needed for OSG to do its work, so you can't do much about that. Possible solutions might be to move to a 64 bit OS, use database paging (PagedLOD nodes) to only load parts of the scene initially and only load other parts when they're in view, etc.
Hope this helps, J-S -- ______________________________________________________ Jean-Sebastien Guay [email protected] http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

