xinyiZzz commented on code in PR #8669:
URL: https://github.com/apache/incubator-doris/pull/8669#discussion_r843677980


##########
be/src/runtime/thread_mem_tracker_mgr.h:
##########
@@ -217,14 +217,14 @@ inline void ThreadMemTrackerMgr::cache_consume(int64_t 
size) {
     if (_untracked_mem >= config::mem_tracker_consume_min_size_bytes ||
         _untracked_mem <= -config::mem_tracker_consume_min_size_bytes) {
         DCHECK(_untracked_mems.find(_tracker_id) != _untracked_mems.end());
+        start_thread_mem_tracker = false;

Review Comment:
   Avoid getting into infinite recursion if there is a temporary memory 
allocation in mem_tracker.consume/try_consume.
   
   It is mentioned in the comments of `tcmalloc_hook.h`: Allocating memory in 
the Hook command causes the Hook to be entered again, infinite recursion.
   
   This needs to ensure that all memory allocated in 
mem_tracker.consume/try_consume is freed in time to avoid tracking misses.
   
   Add comments when modifying uniformly.



-- 
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