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

dataroaring pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit a6382105b494e1351c6ed51445c539a533bb5abc
Author: Yongqiang YANG <98214048+dataroar...@users.noreply.github.com>
AuthorDate: Fri Dec 2 09:18:23 2022 +0800

    (tcmalloc) gc does not work in somecases (#14732)
    
    gc does not work in some cases
---
 be/src/common/daemon.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index c0d3fee21f..27e91d6d5e 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -135,16 +135,13 @@ void Daemon::tcmalloc_gc_thread() {
                 to_free_bytes = std::max(to_free_bytes, tc_cached_bytes * 30 / 
100);
                 to_free_bytes = std::min(to_free_bytes, tc_cached_bytes);
                 expected_aggressive_decommit = 1;
-            } else {
-                // release rate is enough.
-                to_free_bytes = 0;
             }
             last_ms = kMaxLastMs;
         } else if (memory_pressure > (pressure_limit - 10)) {
+            // In most cases, adjusting release rate is enough, if memory are 
consumed quickly
+            // we should release manually.
             if (last_memory_pressure <= (pressure_limit - 10)) {
                 to_free_bytes = std::max(to_free_bytes, tc_cached_bytes * 10 / 
100);
-            } else {
-                to_free_bytes = 0;
             }
         }
 
@@ -178,6 +175,7 @@ void Daemon::tcmalloc_gc_thread() {
                 last_ms = 0;
             }
         } else {
+            DCHECK(tc_cached_bytes <= tc_used_bytes * max_cache_percent / 100);
             last_ms = 0;
         }
     }


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

Reply via email to