Skip to content

Commit

Permalink
[opt](memory) QueryMemTracker not equal to 0 will crash at query end …
Browse files Browse the repository at this point in the history
…when Debug compile (apache#35014)

to eliminate query memory leak !!!
  • Loading branch information
xinyiZzz committed Sep 13, 2024
1 parent 03d920e commit 5768c18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions be/src/runtime/memory/mem_tracker_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ MemTrackerLimiter::~MemTrackerLimiter() {
"4. If you need to "
"transfer memory tracking value between two trackers, can use transfer_to.";
if (_consumption->current_value() != 0) {
// TODO, expect mem tracker equal to 0 at the task end.
// TODO, expect mem tracker equal to 0 at the load/compaction/etc. task end.
#ifndef NDEBUG
if (_type == Type::QUERY) {
std::string err_msg =
fmt::format("mem tracker label: {}, consumption: {}, peak consumption: {}, {}.",
label(), _consumption->current_value(), _consumption->peak_value(),
mem_tracker_inaccurate_msg);
LOG(INFO) << err_msg << print_address_sanitizers();
LOG(FATAL) << err_msg << print_address_sanitizers();
}
#endif
if (ExecEnv::tracking_memory()) {
Expand Down

0 comments on commit 5768c18

Please sign in to comment.