prg_mem_stats_total_usage_get()
Abstract
Gets the total memory usage for general, pooled, categorized, or all memory, or a specified sub-category thereof.
Syntax
prg_mem_stats_total_usage_get (threshold, mem_cat, sub_cat_name)
| Argument | Type | Description |
|---|---|---|
threshold |
int |
Minimum size of memory block to consider when calculating total usage (blocks smaller than threshold are ignored). |
mem_cat |
PrgT_Memstats_Usage_Category |
Memory category for which to report usage; one of the values in Table 5 Memory and Pooled Memory Package Symbolic Constants. |
sub_cat_name |
const char * |
Optional sub-category name for which to report usage (see Details). |
Return Type
int
The requested memory usage, in kilobytes.
Header
prg_mem_funcs.h
Example
/* get the total memory usage after the first time */
if (index == 1)
usage_first = prg_mem_stats_total_usage_get (0,
PrgC_Memstats_Usage_Category_All, NULL);
else if (index == total / 2)
usage_mid = prg_mem_stats_total_usage_get (0,
PrgC_Memstats_Usage_Category_All, NULL);
Details
If sub_cat_name is NULL, the total memory usage for the specified category will be returned; otherwise, usage for that sub-category will be returned. Usage is 0 if the sub-category does not exist.
Note: Only total memory usage is reported if the “mem_optimize“ preference is set to FALSE.
Purpose
Provides a way to get total memory usage for general, pooled, categorized, or all memory, or a specified sub-category thereof.
Errors
- None
Reference
- None