Estimate the amount of disk cache memory used by persistent objects of each class.
MCO_RET mco_disk_cache_usage(
/*IN*/ mco_db_h db,
/*OUT*/ mco_size_t *classes
);
db
classes
mco_size_t values, where each element corresponds to a class in the
database dictionary. The function writes the estimated cached size (in bytes) for each class into this array.
The array must be large enough to hold n_class_codes elements (typically MCO_MAX_CLASSES).This function scans all pages of persistent storage that are currently loaded in the disk cache and estimates the total memory footprint of cached objects for each class.
It uses the
PAGE_PROBEflag during page iteration, which means it only considers pages that are already present in the cache — pages not loaded into memory are skipped.The function is primarily intended for diagnostic and monitoring purposes.
Important limitations:
- The reported size is an estimate, not an exact measurement.
- For objects spanning multiple pages, the function assumes the entire object is in memory if any of its pages are cached.
- For fixed-size objects, it sums the size of allocated objects on cached pages but does not account for internal fragmentation or free space within fixed-record allocator pages.
- Only persistent (disk-based) classes are considered; in-memory classes are ignored.
MCO_S_OK