yiguolei commented on code in PR #34985: URL: https://github.com/apache/doris/pull/34985#discussion_r1606211097
########## 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: 应该是在切换memtracker的时候,如果发现上一个memtracker的reserved bytes != 0,那么应该直接DCHECK 挂掉。 -- 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