From d66b94cc17078cab1e7a06b144e99892a8622faa Mon Sep 17 00:00:00 2001 From: Xinyi Zou Date: Wed, 28 Aug 2024 21:55:52 +0800 Subject: [PATCH] 5 --- be/src/runtime/memory/mem_tracker_limiter.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/be/src/runtime/memory/mem_tracker_limiter.cpp b/be/src/runtime/memory/mem_tracker_limiter.cpp index 2f733f0837f9796..6cb92900458ef57 100644 --- a/be/src/runtime/memory/mem_tracker_limiter.cpp +++ b/be/src/runtime/memory/mem_tracker_limiter.cpp @@ -114,7 +114,7 @@ MemTrackerLimiter::~MemTrackerLimiter() { "mem tracker not equal to 0 when mem tracker destruct, this usually means that " "memory tracking is inaccurate and SCOPED_ATTACH_TASK and " "SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER are not used correctly. " - "If the log is truncated, search for `address sanitizer` in the be.INFO log to see " + "If the log is truncated, search for `Address Sanitizer` in the be.INFO log to see " "more information." "1. For query and load, memory leaks may have occurred, it is expected that the query " "mem tracker will be bound to the thread context using SCOPED_ATTACH_TASK and " @@ -206,15 +206,17 @@ std::string MemTrackerLimiter::print_address_sanitizers() { detail += "\n memory not be freed:"; for (const auto& it : _address_sanitizers) { auto msg = fmt::format( - "\n [Address Sanitizer] buf not be freed: {}, size {}, strack trace: {}", - it.first, it.second.size, it.second.stack_trace); + "\n [Address Sanitizer] buf not be freed, mem tracker label: {}, consumption: " + "{}, peak consumption: {}, buf: {}, size {}, strack trace: {}", + _label, _consumption->current_value(), _consumption->peak_value(), it.first, + it.second.size, it.second.stack_trace); LOG(INFO) << msg; - detail += msg; + // detail += msg; } detail += "\n incorrect memory alloc and free:"; for (const auto& err_msg : _error_address_sanitizers) { LOG(INFO) << err_msg; - detail += fmt::format("\n {}", err_msg); + // detail += fmt::format("\n {}", err_msg); } return detail; }