|void||Show_Memory_Usage (long *allocated, long *in_use)|
|Tells your program how much memory is being used for graphics data storage. More...|
|void Show_Memory_Usage||(||long *||allocated,|
Tells your program how much memory is being used for graphics data storage.
allocated - The total amount of memory that HOOPS has obtained from the operating system, in bytes. Passed by reference always. Returned to user. in_use - The portion of the allocated memory, which is currently holding useful information, in bytes. Passed by reference always. Returned to user.
Almost everything in HOOPS involves utilization of system memory: setting attributes, storing geometry and segments, etc...
It may be useful to know how much memory HOOPS is using to store scene-graph information. HOOPS utilizes its own internal memory-manager. It generally allocates memory in large chunks from the operating system, then parcels the chunks out as needed for information to be stored in the database. Even after segments/geometry are deleted, HOOPS will keep around some cached information, as well as the chunks of memory associated with the deleted items, effectively 'recycling' them. Allocated indicates the total size of all the chunks; in_use indicates the amount that's currently parcelled out.
The memory usage information is also useful during debugging: you might be able to use it to determine if your program (or perhaps HOOPS) is "leaking" memory, i.e., not cleaning up the segment tree properly after a procedure is finished. This can be important if your application will run for long periods of time at a stretch.
Some changes and deletions in the database might cause immediate changes in the memory usage statistics, while others might be delayed until after the next Update.
Because of the nature of HOOPS built-in memory allocation methods, only a call to Relinquish_Memory() or Reset_System() can clean up the allocated-but-not-in_use memory and return it to the operating system. However, Relinquish_Memory() should be used with care, if ever, so be sure to review its Notes.