From b0814bdd422d39ccc19d1f321c2eddb12bbbeeb5 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Tue, 4 Oct 2022 13:06:14 +0300 Subject: [PATCH] api: column_family: fix memtable off-heap memory reporting We report virtual memory used, but that's not a real accounting of the actual memory used. Use the correct real_memory_used() instead. Note that this isn't a recent regression and was probably broken forever. However nobody looks at this measure (and it's usually close to the correct value) so nobody noticed. Since it's so minor, I didn't bother filing an issue. --- api/column_family.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/column_family.cc b/api/column_family.cc index 1fe7c2bb01..02c86a6869 100644 --- a/api/column_family.cc +++ b/api/column_family.cc @@ -394,7 +394,7 @@ void set_column_family(http_context& ctx, routes& r) { cf::get_all_cf_all_memtables_off_heap_size.set(r, [&ctx] (std::unique_ptr req) { warn(unimplemented::cause::INDEXES); return ctx.db.map_reduce0([](const replica::database& db){ - return db.dirty_memory_region_group().virtual_memory_used(); + return db.dirty_memory_region_group().real_memory_used(); }, int64_t(0), std::plus()).then([](int res) { return make_ready_future(res); });