vagetablechicken commented on issue #3273: fragment mem tracker doesn't be 
unregistered from parent
URL: 
https://github.com/apache/incubator-doris/issues/3273#issuecomment-610717223
 
 
   > @vagetablechicken
   > I'm not sure what is your mean by "the top level is needed". Could you 
please explain more carefully?
   
   OK. We can regard mem trackers as nodes. 
   _There are many trees, cause we may create a mem tracker as a no-parent 
node. But we don't need to pay attention on them._ 
   
   Focus on one plan fragment, 
   the root mem tracker is exec_env_mem_tracker(level 0), and
   the query_mem_tracker &  fragment_mem_tracker are the root node's 
children(level 1). These can be called top-level nodes.
   And the low-level nodes, such as scan node's mem_tracker, sink node's 
mem_tracker...(level >=2)
   
   Low-level mem trackers will be destroyed when plan finished. And the 
top-level mem trackers will be destroyed too. 
   For example, the fragment_mem_tracker, we don't need to worry about dangling 
pointers(child trackers) in it, because it will be destroyed when plan fragment 
finished,
   But the fragment_mem_tracker's pointer in exec_env_mem_tracker is never 
delete. If we use exec_env_mem_tracker and visit its children, we may access 
the deallocated memory.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to