xinyiZzz opened a new pull request, #26904:
URL: https://github.com/apache/doris/pull/26904

   ## Proposed changes
   
   1. Manually track query/load/compaction/etc. memory in Allocator instead of 
mem hook.  
   This will cause memory tracking loss for Query, but this is expected to be 
more controllable and does not require caching bthread local in pthread local 
for performance.
   
   Use MemHook in the past:
   
   Manual tracking in Allocator:
   
![image](https://github.com/apache/doris/assets/13197424/831aeb0a-b621-47cf-bec1-551e9313dc7d)
   
![image](https://github.com/apache/doris/assets/13197424/5067d08c-2b37-4612-9d4e-ff55b68a5f4d)
   
   2. ThreadContext life cycle to manual control
   In the past, ThreadContext was automatically created when it was used for 
the first time (this was usually in the Jemalloc Hook when the first malloc 
memory), and was automatically destroyed when the thread exited.
   
   Now instead of manually controlling the create and destroy of ThreadContext, 
it is mainly created manually when the task thread start and destroyed before 
the task thread end.
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[[email protected]](mailto:[email protected]) by explaining why you 
chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to