yiguolei commented on code in PR #33396:
URL: https://github.com/apache/doris/pull/33396#discussion_r1568647252


##########
be/src/runtime/memory/mem_tracker_limiter.cpp:
##########
@@ -115,19 +121,101 @@ MemTrackerLimiter::~MemTrackerLimiter() {
     if (_consumption->current_value() != 0) {
         // TODO, expect mem tracker equal to 0 at the task end.
         if (doris::config::enable_memory_orphan_check && _type == Type::QUERY) 
{
-            LOG(INFO) << "mem tracker label: " << _label
-                      << ", consumption: " << _consumption->current_value()
-                      << ", peak consumption: " << _consumption->peak_value()
-                      << mem_tracker_inaccurate_msg;
+            std::string err_msg =
+                    fmt::format("mem tracker label: {}, consumption: {}, peak 
consumption: {}, {}.",
+                                label(), _consumption->current_value(), 
_consumption->peak_value(),
+                                mem_tracker_inaccurate_msg);
+#ifdef NDEBUG
+            LOG(INFO) << err_msg;
+#else
+            LOG(FATAL) << err_msg << print_address_sanitizers();
+#endif
         }
         if (ExecEnv::tracking_memory()) {
             
ExecEnv::GetInstance()->orphan_mem_tracker()->consume(_consumption->current_value());
         }
         _consumption->set(0);
+#ifndef NDEBUG
+    } else if (!_address_sanitizers.empty()) {
+        LOG(FATAL) << "[Address Sanitizer] consumption is 0, but address 
sanitizers not empty. "
+                   << ", mem tracker label: " << _label
+                   << ", peak consumption: " << _consumption->peak_value()
+                   << print_address_sanitizers();
+#endif
     }
     g_memtrackerlimiter_cnt << -1;
 }
 
+#ifndef NDEBUG
+static size_t allocator_malloc_usable_size(void* ptr) {
+#ifdef USE_JEMALLOC
+    return jemalloc_usable_size(ptr);
+#else
+    return 0; // malloc_usable_size(ptr);
+#endif
+}

Review Comment:
   这是不是错了?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to