Skip to content

Commit

Permalink
branch-3.0: [fix](memory) Fix adjust cache capacity #45603 (#45665)
Browse files Browse the repository at this point in the history
Cherry-picked from #45603

Co-authored-by: Xinyi Zou <[email protected]>
  • Loading branch information
github-actions[bot] and xinyiZzz authored Dec 19, 2024
1 parent 0359312 commit d84ee07
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions be/src/common/daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ void refresh_memory_state_after_memory_change() {
}

void refresh_cache_capacity() {
if (doris::GlobalMemoryArbitrator::cache_adjust_capacity_notify.load(
std::memory_order_relaxed)) {
// the last cache capacity adjustment has not been completed.
return;
}
if (refresh_cache_capacity_sleep_time_ms <= 0) {
auto cache_capacity_reduce_mem_limit = int64_t(
doris::MemInfo::soft_mem_limit() * config::cache_capacity_reduce_mem_limit_frac);
Expand All @@ -247,6 +252,8 @@ void refresh_cache_capacity() {
new_cache_capacity_adjust_weighted;
doris::GlobalMemoryArbitrator::notify_cache_adjust_capacity();
refresh_cache_capacity_sleep_time_ms = config::memory_gc_sleep_time_ms;
} else {
refresh_cache_capacity_sleep_time_ms = 0;
}
}
refresh_cache_capacity_sleep_time_ms -= config::memory_maintenance_sleep_time_ms;
Expand Down

0 comments on commit d84ee07

Please sign in to comment.