From 39ea011a73994ca931cc4c338aefa3433216a4b1 Mon Sep 17 00:00:00 2001 From: caiconghui1 Date: Mon, 21 Mar 2022 18:40:04 +0800 Subject: [PATCH] fix --- be/src/olap/lru_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/be/src/olap/lru_cache.cpp b/be/src/olap/lru_cache.cpp index ac494819c93065..825f029e8dc652 100644 --- a/be/src/olap/lru_cache.cpp +++ b/be/src/olap/lru_cache.cpp @@ -364,12 +364,13 @@ void LRUCache::erase(const CacheKey& key, uint32_t hash, MemTracker* tracker) { } // free handle out of mutex, when last_ref is true, e must not be nullptr if (last_ref) { + size_t charge = e->charge; e->free(); // The parameter tracker is ShardedLRUCache::_mem_tracker, // because the memory released by LRUHandle is recorded in the tls mem tracker, // so this part of the memory is subsidized from ShardedLRUCache::_mem_tracker to the tls mem tracker tracker->transfer_to(thread_local_ctx.get()->_thread_mem_tracker_mgr->mem_tracker().get(), - e->charge); + charge); } }