From 65206b0446d243470219afa171a8a5dae6e8c8e6 Mon Sep 17 00:00:00 2001 From: yiguolei Date: Wed, 31 Dec 2025 09:29:56 +0800 Subject: [PATCH] [memorygc](lrucache) do not prune memory if prune is disabled (#59478) ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason - Behavior changed: - [ ] No. - [ ] Yes. - Does this need documentation? - [ ] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label --- be/src/runtime/memory/lru_cache_policy.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/be/src/runtime/memory/lru_cache_policy.h b/be/src/runtime/memory/lru_cache_policy.h index c06a6a03982011..a33fa0cb262416 100644 --- a/be/src/runtime/memory/lru_cache_policy.h +++ b/be/src/runtime/memory/lru_cache_policy.h @@ -254,7 +254,11 @@ class LRUCachePolicy : public CachePolicy { if (_cache == ExecEnv::GetInstance()->get_dummy_lru_cache()) { return 0; } - + if (!_enable_prune) { + LOG(INFO) << "[MemoryGC] " << type_string(_type) + << " cache prune disabled, so could not adjust capacity to free memory"; + return 0; + } size_t old_capacity = get_capacity(); int64_t old_mem_consumption = mem_consumption(); int64_t old_usage = get_usage();