xinyiZzz commented on code in PR #34985: URL: https://github.com/apache/doris/pull/34985#discussion_r1606234238
########## be/src/runtime/memory/thread_mem_tracker_mgr.h: ########## @@ -209,14 +243,58 @@ inline void ThreadMemTrackerMgr::flush_untracked_mem() { _stop_consume = true; DCHECK(_limiter_tracker_raw); - old_untracked_mem = _untracked_mem; - if (_count_scope_mem) _scope_mem += _untracked_mem; - _limiter_tracker_raw->consume(old_untracked_mem); - for (auto tracker : _consumer_tracker_stack) { - tracker->consume(old_untracked_mem); + _old_untracked_mem = _untracked_mem; + if (_count_scope_mem) { + _scope_mem += _untracked_mem; + } + _limiter_tracker_raw->consume(_old_untracked_mem); + for (auto* tracker : _consumer_tracker_stack) { + tracker->consume(_old_untracked_mem); } - _untracked_mem -= old_untracked_mem; + _untracked_mem -= _old_untracked_mem; _stop_consume = false; } +inline bool ThreadMemTrackerMgr::try_reserve(int64_t size) { Review Comment:  加了个 DCHECK,不过不可能发生你说的情况,因为 reserve 必须在 scoped attach task 内,scoped结束时 detach task 时会调 `release_reserved()` -- 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