From c90743ecb21aebe1e5e1e233f2e9c923b9a2246d Mon Sep 17 00:00:00 2001 From: Kaijie Chen Date: Wed, 25 Sep 2024 14:14:35 +0800 Subject: [PATCH] [fix](load) fix memtable memory limiter total mem usage (#41245) ## Proposed changes Previously, `mem_usage = write_mem + flush_mem`, because `active_mem` is included in `write_mem`. After #40912, `write_mem` becomes `queue_mem`, which no longer includes `active_mem`. This PR fixes this problem, by setting `mem_usage = active_mem + queue_mem + flush_mem` --- be/src/olap/memtable_memory_limiter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/olap/memtable_memory_limiter.cpp b/be/src/olap/memtable_memory_limiter.cpp index 5504e8d91acf0f..464e729c1b4499 100644 --- a/be/src/olap/memtable_memory_limiter.cpp +++ b/be/src/olap/memtable_memory_limiter.cpp @@ -254,7 +254,7 @@ void MemTableMemoryLimiter::_refresh_mem_tracker() { _writers.pop_back(); } } - _mem_usage = _flush_mem_usage + _queue_mem_usage; + _mem_usage = _active_mem_usage + _queue_mem_usage + _flush_mem_usage; g_memtable_active_memory.set_value(_active_mem_usage); g_memtable_write_memory.set_value(_queue_mem_usage); g_memtable_flush_memory.set_value(_flush_mem_usage);