Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
caches.h
Go to the documentation of this file.
1// Copyright (c) 2024-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_KERNEL_CACHES_H
6#define BITCOIN_KERNEL_CACHES_H
7
8#include <util/byte_units.h>
9
10#include <algorithm>
11#include <cstdint>
12#include <limits>
13
15inline constexpr uint64_t MIN_DBCACHE_BYTES{4_MiB};
17inline constexpr uint64_t MAX_DBCACHE_BYTES{sizeof(void*) == 4 ? 1_GiB : std::numeric_limits<uint64_t>::max()};
19inline constexpr uint64_t DEFAULT_KERNEL_CACHE{450_MiB};
22
24inline constexpr uint64_t MAX_BLOCK_DB_CACHE{2_MiB};
26inline constexpr uint64_t MAX_COINS_DB_CACHE{8_MiB};
27
28namespace kernel {
43} // namespace kernel
44
45#endif // BITCOIN_KERNEL_CACHES_H
constexpr uint64_t MAX_BLOCK_DB_CACHE
Max memory allocated to block tree DB specific cache (bytes)
Definition caches.h:24
constexpr uint64_t MAX_DBCACHE_BYTES
Maximum total database cache on current architecture (bytes)
Definition caches.h:17
constexpr uint64_t DEFAULT_DB_CACHE_BATCH
Default LevelDB write batch size.
Definition caches.h:21
constexpr uint64_t DEFAULT_KERNEL_CACHE
Suggested default amount of cache reserved for the kernel (bytes)
Definition caches.h:19
constexpr uint64_t MAX_COINS_DB_CACHE
Max memory allocated to coin DB specific cache (bytes)
Definition caches.h:26
constexpr uint64_t MIN_DBCACHE_BYTES
Minimum total database cache (bytes)
Definition caches.h:15
CacheSizes(uint64_t total_cache)
Definition caches.h:34
uint64_t block_tree_db
Definition caches.h:30
uint64_t coins
Definition caches.h:32
uint64_t coins_db
Definition caches.h:31
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:82