Bitcoin Core 32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
caches_tests.cpp
Go to the documentation of this file.
1// Copyright (c) The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://opensource.org/license/mit.
4
5#include <kernel/caches.h>
6#include <node/caches.h>
7#include <util/byte_units.h>
8
9#include <boost/test/unit_test.hpp>
10
11#include <cstdint>
12
13using namespace node;
14
15namespace {
17{
20}
21} // namespace
22
24
26{
28
29 // Below DBCACHE_WARNING_RESERVED_RAM the existing fixed default dominates.
32
33 // Above DBCACHE_WARNING_RESERVED_RAM the warning fires at 75% of the headroom.
35
36 for (const auto total_ram : {8_GiB, 16_GiB, 32_GiB}) {
38 }
39}
40
BOOST_AUTO_TEST_CASE(oversized_dbcache_warning)
BOOST_AUTO_TEST_SUITE_END()
constexpr uint64_t DEFAULT_KERNEL_CACHE
Suggested default amount of cache reserved for the kernel (bytes)
Definition caches.h:19
constexpr uint64_t MIN_DBCACHE_BYTES
Minimum total database cache (bytes)
Definition caches.h:15
constexpr bool ShouldWarnOversizedDbCache(uint64_t dbcache, uint64_t total_ram) noexcept
Definition caches.h:32
constexpr uint64_t DBCACHE_WARNING_RESERVED_RAM
Reserved non-dbcache memory usage.
Definition caches.h:18
#define BOOST_CHECK(expr)
Definition object.cpp:16
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition time.h:82