From 486a77fec0b84f081a8ca7054aa1ebfbb326d3dd Mon Sep 17 00:00:00 2001 From: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com> Date: Wed, 30 Nov 2022 11:29:57 +0800 Subject: [PATCH] [fix](tcmalloc) use low_watermark instead of hard_mem_limit (#14660) * [fix](tcmalloc) use low_watermark instead of hard_mem_limit hard_mem_limit is removed. * format --- be/src/common/daemon.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp index d8e6ff0a69..497edd3037 100644 --- a/be/src/common/daemon.cpp +++ b/be/src/common/daemon.cpp @@ -80,7 +80,9 @@ void Daemon::tcmalloc_gc_thread() { double release_rates[10] = {1.0, 1.0, 1.0, 5.0, 5.0, 20.0, 50.0, 100.0, 500.0, 2000.0}; int64_t pressure_limit = 90; bool is_performance_mode = false; - size_t physical_limit_bytes = std::min(MemInfo::hard_mem_limit(), MemInfo::mem_limit()); + size_t physical_limit_bytes = + std::min(MemInfo::physical_mem() - MemInfo::sys_mem_available_low_water_mark(), + MemInfo::mem_limit()); if (config::memory_mode == std::string("performance")) { max_cache_percent = 100;