30 if (std::optional<int64_t> db_cache =
args.
GetIntArg(
"-dbcache")) {
31 if (*db_cache < 0) db_cache = 0;
32 uint64_t db_cache_bytes = SaturatingLeftShift<uint64_t>(*db_cache, 20);
33 constexpr auto max_db_cache{
sizeof(
void*) == 4 ?
MAX_32BIT_DBCACHE : std::numeric_limits<size_t>::max()};
34 total_cache = std::max<size_t>(
MIN_DB_CACHE, std::min<uint64_t>(db_cache_bytes, max_db_cache));
static constexpr size_t MAX_32BIT_DBCACHE
Maximum dbcache size on 32-bit systems.
static constexpr size_t MAX_FILTER_INDEX_CACHE
Max memory allocated to all block filter index caches combined in bytes.
static constexpr size_t MAX_TX_INDEX_CACHE
Max memory allocated to tx index DB specific cache in bytes.
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
CacheSizes CalculateCacheSizes(const ArgsManager &args, size_t n_indexes)
static constexpr size_t MIN_DB_CACHE
min. -dbcache (bytes)
static constexpr size_t DEFAULT_DB_CACHE
-dbcache default (bytes)
static constexpr bool DEFAULT_TXINDEX