The primary concern here is HOOPS Visualize's usage of system main memory. The dynamic allocation and releasing of memory in Visualize is controlled by an internal memory manager. The memory manager may allocate memory in numerous situations, such as when objects are inserted into the database, an update is performed, or files are loaded. As items are removed from the database, the memory manager takes care of the freeing of the memory associated with them. Visualize allocates memory using its own memory pool and attempts to reuse memory chunks after entities are deleted.
The amount of memory in use can be queried using HPS::Database::ShowMemoryUsage. This function will tell us how much system memory HOOPS has allocated and how much is currently in use. "Allocated" refers to the amount of system memory allocated by Visualize's memory manager. "In use" refers to the amount of memory currently used by the HOOPS scene-graph, which may be less than the amount actually allocated.
HPS::WindowInfoControl::ShowVideoMemory can be used to query the total amount of video memory available in the execution environment. However, there are no APIs to strictly query HOOPS Visualize's usage of frame buffer memory. But that should not be a big concern, because it's not system memory usage; rather, it's video memory allocated on the video card.
The amount of system-memory that HOOPS Visualize has allocated is always going to be the allocated value of ShowMemoryUsage. All other system memory usage is due to the application's other data-structures, along with any other system memory usage that is not explicitly allocated by HOOPS Visualize.
What this means is that when HOOPS tells the graphics API (OpenGL or Direct3D), to allocate display lists or vertex buffer objects in the video memory, the lower-level OpenGL/Direct3D drivers may ALSO choose to shadow/backup the graphics items in system memory. For example, the graphics card may be caching 1GB of graphical entities in the video memory, but maybe 500MB of that is ALSO backed up in system memory. HOOPS Visualize has no knowledge or control over that lower-level system memory usage.
See also:
https://docs.techsoft3d.com/hps/latest/build/prog_guide/0704_memory_management.htmlLearn more in our forum post.