This is an automated email from the ASF dual-hosted git repository.

zouxinyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 6cce4087f94 [fix](memory) Process available memory to increase the 
Jemalloc cache (#45621)
6cce4087f94 is described below

commit 6cce4087f94b5ef91b7ffcba294b4c5da79f1f14
Author: Xinyi Zou <zouxi...@selectdb.com>
AuthorDate: Thu Dec 19 19:56:38 2024 +0800

    [fix](memory) Process available memory to increase the Jemalloc cache 
(#45621)
    
    ### What problem does this PR solve?
    
    Currently, when the Doris BE process exceed memory limit, Jemalloc cache
    will be manually released.
    Add the Jemalloc cache to the available memory of the BE process is
    expected to have little impact on the risk of the process OOM killer.
    the process memory used has already subtracted the Jemalloc cache.
    
    Not merge to 2.1 because 2.1 is stable now
---
 be/src/runtime/memory/global_memory_arbitrator.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/be/src/runtime/memory/global_memory_arbitrator.h 
b/be/src/runtime/memory/global_memory_arbitrator.h
index 075113088fb..a7a85725ab1 100644
--- a/be/src/runtime/memory/global_memory_arbitrator.h
+++ b/be/src/runtime/memory/global_memory_arbitrator.h
@@ -76,7 +76,7 @@ public:
     static inline int64_t sys_mem_available() {
         return MemInfo::_s_sys_mem_available.load(std::memory_order_relaxed) -
                refresh_interval_memory_growth.load(std::memory_order_relaxed) -
-               process_reserved_memory();
+               process_reserved_memory() + 
static_cast<int64_t>(MemInfo::allocator_cache_mem());
     }
 
     static inline std::string sys_mem_available_str() {
@@ -91,12 +91,14 @@ public:
     static inline std::string sys_mem_available_details_str() {
         auto msg = fmt::format(
                 "sys available memory {}(= {}[proc/available] - {}[reserved] - 
"
-                "{}B[waiting_refresh])",
+                "{}B[waiting_refresh] + {}[tc/jemalloc_cache])",
                 PrettyPrinter::print(sys_mem_available(), TUnit::BYTES),
                 
PrettyPrinter::print(MemInfo::_s_sys_mem_available.load(std::memory_order_relaxed),
                                      TUnit::BYTES),
                 PrettyPrinter::print(process_reserved_memory(), TUnit::BYTES),
-                refresh_interval_memory_growth);
+                refresh_interval_memory_growth,
+                
PrettyPrinter::print(static_cast<uint64_t>(MemInfo::allocator_cache_mem()),
+                                     TUnit::BYTES));
 #ifdef ADDRESS_SANITIZER
         msg = "[ASAN]" + msg;
 #endif


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to