Skip to content

Commit 6bd2501

Browse files
yiguoleiYour Name
authored andcommitted
[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 <!-- At least one of them must be included. --> - [ ] 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 <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
1 parent 734486e commit 6bd2501

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

be/src/runtime/memory/lru_cache_policy.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,11 @@ class LRUCachePolicy : public CachePolicy {
254254
if (std::dynamic_pointer_cast<doris::DummyLRUCache>(_cache)) {
255255
return 0;
256256
}
257-
257+
if (!_enable_prune) {
258+
LOG(INFO) << "[MemoryGC] " << type_string(_type)
259+
<< " cache prune disabled, so could not adjust capacity to free memory";
260+
return 0;
261+
}
258262
size_t old_capacity = get_capacity();
259263
int64_t old_mem_consumption = mem_consumption();
260264
int64_t old_usage = get_usage();

0 commit comments

Comments
 (0)