ec_mem_get_stats — Return usage statistics for all memtypes
int **ec_mem_get_stats** ( | sysstats, | |
| | usage_by_type, | |
| | nelems
); | |
**Configuration Change. ** This feature is available starting from Momentum 3.0.18.
Return usage statistics for all memtypes. For more information about memory types see Memory Types. It fills out the ec_mem_stats structures with a snapshot of the memory utilization.
It is possible, even likely, that the individual numbers are not 100% consistent with each other, as the allocator layer deliberately avoids a global lock across memory types. Since allocations are being made asynchronously, it is possible that the numbers will change before this routine completes.
The caller is responsible for providing a big enough array of ec_mem_type_usage structures. If the provided array is too small, this function will stop short of overflowing it, and will return the number of registered memtypes. The constant
MEMTYPE_MAX defines the maximum number of memtypes supported by the allocator; it is easiest to declare a stack variable with
MEMTYPE_MAX elements and pass that to this function.
A buffer to hold system level information. For a description of this data type see “ec_mem_stats”.
An array to hold per-memtype information.
The number of elements that can be written to in
This function returns the number of defined memtypes.
It is legal to call this function in any thread.