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

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

commit b4aba703aa260e95c6dd36937363f069a5cc45e5
Author: Xinyi Zou <zouxiny...@gmail.com>
AuthorDate: Mon Apr 3 20:37:14 2023 +0800

    [fix](memory) Fix memtable flush mem tracker #18330
---
 be/src/common/daemon.cpp | 3 ++-
 be/src/olap/memtable.cpp | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/be/src/common/daemon.cpp b/be/src/common/daemon.cpp
index 322b19b159..176ab1dc64 100644
--- a/be/src/common/daemon.cpp
+++ b/be/src/common/daemon.cpp
@@ -230,8 +230,9 @@ void Daemon::memory_maintenance_thread() {
                 
DorisMetrics::instance()->system_metrics()->update_allocator_metrics();
             }
 #endif
+            LOG(INFO) << MemTrackerLimiter::
+                            process_mem_log_str(); // print mem log when 
memory state by 100M
             if (doris::config::memory_debug) {
-                LOG(INFO) << MemTrackerLimiter::process_mem_log_str();
                 LOG_EVERY_N(INFO, 10)
                         << 
doris::MemTrackerLimiter::log_process_usage_str("memory debug", false);
             }
diff --git a/be/src/olap/memtable.cpp b/be/src/olap/memtable.cpp
index 4f1fc2833b..226f063988 100644
--- a/be/src/olap/memtable.cpp
+++ b/be/src/olap/memtable.cpp
@@ -448,7 +448,6 @@ Status MemTable::_generate_delete_bitmap(int64_t 
atomic_num_segments_before_flus
 }
 
 Status MemTable::flush() {
-    SCOPED_CONSUME_MEM_TRACKER(_flush_mem_tracker);
     VLOG_CRITICAL << "begin to flush memtable for tablet: " << tablet_id()
                   << ", memsize: " << memory_usage() << ", rows: " << _rows;
     int64_t duration_ns = 0;
@@ -470,6 +469,7 @@ Status MemTable::flush() {
 }
 
 Status MemTable::_do_flush(int64_t& duration_ns) {
+    SCOPED_CONSUME_MEM_TRACKER(_flush_mem_tracker);
     SCOPED_RAW_TIMER(&duration_ns);
     if (_skip_list) {
         Status st = _rowset_writer->flush_single_memtable(this, &_flush_size);


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

Reply via email to