aboutsummaryrefslogtreecommitdiffstats
path: root/vespalib/src/tests/btree
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-03-09 14:10:14 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-03-09 14:10:58 +0000
commit414f81bdd8fa59944f79d86b9ca7c03d1e4080f4 (patch)
treedf92895f93a0446ff6ed1ee410af434916e5e449 /vespalib/src/tests/btree
parent435af93308d985ec4c503d3789a6d48f923dd60a (diff)
Report more of the static memory usage for datastores.
Diffstat (limited to 'vespalib/src/tests/btree')
-rw-r--r--vespalib/src/tests/btree/btree_test.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/vespalib/src/tests/btree/btree_test.cpp b/vespalib/src/tests/btree/btree_test.cpp
index 2a465f2c60a..ef64549e16a 100644
--- a/vespalib/src/tests/btree/btree_test.cpp
+++ b/vespalib/src/tests/btree/btree_test.cpp
@@ -1064,6 +1064,7 @@ adjustAllocatedBytes(size_t nodeCount, size_t nodeSize)
TEST_F(BTreeTest, require_that_memory_usage_is_calculated)
{
+ constexpr size_t BASE = 163912;
typedef BTreeNodeAllocator<int32_t, int8_t,
btree::NoAggregated,
MyTraits::INTERNAL_SLOTS, MyTraits::LEAF_SLOTS> NodeAllocator;
@@ -1082,6 +1083,8 @@ TEST_F(BTreeTest, require_that_memory_usage_is_calculated)
const uint32_t initialLeafNodes = 128u;
mu.incAllocatedBytes(adjustAllocatedBytes(initialInternalNodes, sizeof(INode)));
mu.incAllocatedBytes(adjustAllocatedBytes(initialLeafNodes, sizeof(LNode)));
+ mu.incAllocatedBytes(BASE);
+ mu.incUsedBytes(BASE);
mu.incUsedBytes(sizeof(INode));
mu.incDeadBytes(sizeof(INode));
EXPECT_TRUE(assertMemoryUsage(mu, tm.getMemoryUsage()));
@@ -1112,6 +1115,8 @@ TEST_F(BTreeTest, require_that_memory_usage_is_calculated)
mu = vespalib::MemoryUsage();
mu.incAllocatedBytes(adjustAllocatedBytes(initialInternalNodes, sizeof(INode)));
mu.incAllocatedBytes(adjustAllocatedBytes(initialLeafNodes, sizeof(LNode)));
+ mu.incAllocatedBytes(BASE);
+ mu.incUsedBytes(BASE);
mu.incUsedBytes(sizeof(INode) * 2);
mu.incDeadBytes(sizeof(INode) * 2);
mu.incUsedBytes(sizeof(LNode));