HC_Show_Memory_Statistics
-
void
HC_Show_Memory_Statistics(char const *option, void *value) - void HC_Show_Memory_Statistics(char const option, void value)
Tells your program how much memory is being used by the input option.
When the option parameter is “allocated” or “used” the return type of value will be size_t.
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.
HC_Show_Memory_Usage, HC_Reset_System, HC_Relinquish_Memory.Parameters
option: - Indicate what value you want returned to you in the value parameter. Valid inputs are “allocated” and “used”.
value: - The address of the memory to receive the result. Passed by reference always. Returned to user.