From 414f81bdd8fa59944f79d86b9ca7c03d1e4080f4 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 9 Mar 2023 14:10:14 +0000 Subject: Report more of the static memory usage for datastores. --- vespalib/src/tests/btree/btree_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vespalib/src/tests/btree') 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 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)); -- cgit v1.2.3