vagetablechicken opened a new issue #3273: fragment mem tracker doesn't be 
unregistered from parent
URL: https://github.com/apache/incubator-doris/issues/3273
 
 
   **Describe the bug**
   MemTracker ctor will do
   
https://github.com/apache/incubator-doris/blob/83b5455be57d00ef89f9bf6688e05503ab9f3c92/be/src/runtime/mem_tracker.cpp#L65
   
   So before the mem tracker destroyed, we need to do unregister.
   
https://github.com/apache/incubator-doris/blob/4449316d856092fa1df41b55a8f687d35ccf90a7/be/src/runtime/mem_tracker.h#L96
   
   Just focus on the top level, we have exec_env_mem_tracker(it has no parent).
   And if one plan fragment has prepared, we get three mem_trackers
   
   - query_mem_tracker(owned by runtime_state)
   - instance_mem_tracker(owned by runtime_state)
   - fragment_mem_tracker(owned by plan_fragment_executor)
   
   query_mem_tracker & instance_mem_tracker are unregistered in here
   
https://github.com/apache/incubator-doris/blob/a340bc7a00bdbdf93f307c95e33545ed7a2b9245/be/src/runtime/runtime_state.cpp#L155-L172
   
   **But fragment_mem_tracker doesn't be unregistered.**
   So exec_env_mem_tracker will have lots of dangling pointers(child trackers), 
never delete.
   
   It's unnecessary to do bottom level unregistered. But I think the top level 
is needed.
   

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