version  0.0.1
Defines the C++ API for MsPASS
Loading...
Searching...
No Matches
memory_constants.h
1#ifndef _MEMORY_CONSTANTS_H_
2#define _MEMORY_CONSTANTS_H_
3/* This file contains constants used to provide approximate memory use
4estimates for data objects. For arrays and lists of simple types that
5is not difficult to do, but for map, multimap, and set containers that
6cannot be done without traversing the entire tree. As assumption in
7mspass is that such containers consume small amounts of memory relative to
8the time series data and if we commit a small error in estimating memory
9use in those containers it will not cause issues. These constants may
10require tuning with experiences. Initial values set May 2023 by glp
11are guesses.
12*/
13namespace mspass::utility {
14namespace memory_constants {
16const size_t KEY_AVERAGE_SIZE(8);
18const size_t MD_AVERAGE_SIZE(KEY_AVERAGE_SIZE + 16);
26const size_t HISTORYDATA_AVERAGE_SIZE(64);
31const size_t ELOG_AVERAGE_SIZE(128);
33const size_t DATA_GAP_AVERAGE_SIZE(2 * sizeof(double) + sizeof(size_t));
34} // namespace memory_constants
35} // namespace mspass::utility
36#endif