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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 6b11f274b7 [fix](memory) remove memory tracker profile refresh thread 
#22582 (#22608)
6b11f274b7 is described below

commit 6b11f274b78657c187b0a595a309736c44377dd8
Author: Xinyi Zou <[email protected]>
AuthorDate: Fri Aug 4 16:42:53 2023 +0800

    [fix](memory) remove memory tracker profile refresh thread #22582 (#22608)
    
    Memtrackers are usually bound to operators in query/load. If a large number 
of query/loads are stuck, memtrackers will be very large. memory tracker 
profile refresh thread will get stuck on the lock.
    
    This pr is for branch-2.0, I will rewrite the memory profile in the next pr
---
 be/src/common/daemon.cpp | 16 ----------------
 be/src/common/daemon.h   |  2 --
 2 files changed, 18 deletions(-)

diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index cfff81088c..107a3567a1 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -288,14 +288,6 @@ void Daemon::load_channel_tracker_refresh_thread() {
     }
 }
 
-void Daemon::memory_tracker_profile_refresh_thread() {
-    while 
(!_stop_background_threads_latch.wait_for(std::chrono::milliseconds(100)) &&
-           !k_doris_exit) {
-        MemTracker::refresh_all_tracker_profile();
-        MemTrackerLimiter::refresh_all_tracker_profile();
-    }
-}
-
 /*
  * this thread will calculate some metrics at a fix interval(15 sec)
  * 1. push bytes per second
@@ -468,11 +460,6 @@ void Daemon::start() {
             [this]() { this->load_channel_tracker_refresh_thread(); },
             &_load_channel_tracker_refresh_thread);
     CHECK(st.ok()) << st;
-    st = Thread::create(
-            "Daemon", "memory_tracker_profile_refresh_thread",
-            [this]() { this->memory_tracker_profile_refresh_thread(); },
-            &_memory_tracker_profile_refresh_thread);
-    CHECK(st.ok()) << st;
 
     if (config::enable_metric_calculator) {
         st = Thread::create(
@@ -501,9 +488,6 @@ void Daemon::stop() {
     if (_load_channel_tracker_refresh_thread) {
         _load_channel_tracker_refresh_thread->join();
     }
-    if (_memory_tracker_profile_refresh_thread) {
-        _memory_tracker_profile_refresh_thread->join();
-    }
     if (_calculate_metrics_thread) {
         _calculate_metrics_thread->join();
     }
diff --git a/be/src/common/daemon.h b/be/src/common/daemon.h
index 0d840d6452..8266a9b9f0 100644
--- a/be/src/common/daemon.h
+++ b/be/src/common/daemon.h
@@ -48,7 +48,6 @@ private:
     void memory_maintenance_thread();
     void memory_gc_thread();
     void load_channel_tracker_refresh_thread();
-    void memory_tracker_profile_refresh_thread();
     void calculate_metrics_thread();
     void block_spill_gc_thread();
 
@@ -57,7 +56,6 @@ private:
     scoped_refptr<Thread> _memory_maintenance_thread;
     scoped_refptr<Thread> _memory_gc_thread;
     scoped_refptr<Thread> _load_channel_tracker_refresh_thread;
-    scoped_refptr<Thread> _memory_tracker_profile_refresh_thread;
     scoped_refptr<Thread> _calculate_metrics_thread;
     scoped_refptr<Thread> _block_spill_gc_thread;
 };


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to