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

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
     new 71ffa436d3 [enhancement](tcmalloc) add tcmalloc 
aggressive_memory_decommit conf (#12451)
71ffa436d3 is described below

commit 71ffa436d3e068282eba02d5431e3f6d39962780
Author: yixiutt <102007456+yixi...@users.noreply.github.com>
AuthorDate: Thu Sep 8 14:41:48 2022 +0800

    [enhancement](tcmalloc) add tcmalloc aggressive_memory_decommit conf 
(#12451)
    
    Co-authored-by: yixiutt <yi...@selectdb.com>
---
 be/src/common/config.h        | 2 ++
 be/src/service/doris_main.cpp | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/be/src/common/config.h b/be/src/common/config.h
index 902459e6d3..7f1921d496 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -49,6 +49,8 @@ CONF_String(priority_networks, "");
 CONF_mInt64(tc_use_memory_min, "10737418240");
 // free memory rate.[0-100]
 CONF_mInt64(tc_free_memory_rate, "20");
+// tcmallc aggressive_memory_decommit
+CONF_mBool(tc_enable_aggressive_memory_decommit, "true");
 
 // Bound on the total amount of bytes allocated to thread caches.
 // This bound is not strict, so it is possible for the cache to go over this 
bound
diff --git a/be/src/service/doris_main.cpp b/be/src/service/doris_main.cpp
index bce288d6de..9150a16343 100644
--- a/be/src/service/doris_main.cpp
+++ b/be/src/service/doris_main.cpp
@@ -315,6 +315,11 @@ int main(int argc, char** argv) {
     }
 
 #if !defined(ADDRESS_SANITIZER) && !defined(LEAK_SANITIZER) && 
!defined(THREAD_SANITIZER)
+    // Aggressive decommit is required so that unused pages in the TCMalloc 
page heap are
+    // not backed by physical pages and do not contribute towards memory 
consumption.
+    if (doris::config::tc_enable_aggressive_memory_decommit) {
+        
MallocExtension::instance()->SetNumericProperty("tcmalloc.aggressive_memory_decommit",
 1);
+    }
     // Change the total TCMalloc thread cache size if necessary.
     if (!MallocExtension::instance()->SetNumericProperty(
                 "tcmalloc.max_total_thread_cache_bytes",


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

Reply via email to