xinyiZzz commented on a change in pull request #8322:
URL: https://github.com/apache/incubator-doris/pull/8322#discussion_r820210300
##########
File path: be/src/exec/hash_table.cpp
##########
@@ -244,7 +244,7 @@ void HashTable::grow_node_array() {
_alloc_list.push_back(_current_nodes);
_end_list.push_back(_current_nodes + alloc_size);
- _mem_tracker->Consume(alloc_size);
+ _mem_tracker->consume(alloc_size);
Review comment:
> There are too many places call memory tracker and we may lost to add
mem_tracker.consume in some node or thread. If we are following clickhouse's
method, I think it do not need to call memory tracker everywhere and call mem
tracker.consume so many times.
>
> We could attach the running thread to a conext, the context maybe a query
context or a compaction context or olap scanner. And rewrite the new and delete
method to update the memory tracker automatically.
You are right, I have already implemented it like this. In #7198 mentioned
above,
you can see the original design document last year:
https://shimo.im/docs/DT6JXDRkdTvdyV3G
--
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]