[enhancement](memtracker) Optimize exec node memory tracking (#14711)

This commit is contained in:
Xinyi Zou
2022-12-01 14:52:21 +08:00
committed by GitHub
parent b4d32a0c44
commit 176f519fa1
49 changed files with 170 additions and 151 deletions

View File

@ -52,9 +52,9 @@ BlockingJoinNode::~BlockingJoinNode() {
Status BlockingJoinNode::prepare(RuntimeState* state) {
SCOPED_TIMER(_runtime_profile->total_time_counter());
RETURN_IF_ERROR(ExecNode::prepare(state));
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
_build_pool.reset(new MemPool(mem_tracker()));
_build_pool.reset(new MemPool(mem_tracker_held()));
_build_timer = ADD_TIMER(runtime_profile(), "BuildTime");
_left_child_timer = ADD_TIMER(runtime_profile(), "LeftChildTime");
_build_row_counter = ADD_COUNTER(runtime_profile(), "BuildRows", TUnit::UNIT);
@ -93,14 +93,14 @@ Status BlockingJoinNode::close(RuntimeState* state) {
void BlockingJoinNode::build_side_thread(RuntimeState* state, std::promise<Status>* status) {
SCOPED_ATTACH_TASK(state);
SCOPED_CONSUME_MEM_TRACKER(mem_tracker_shared());
SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh_shared());
status->set_value(construct_build_side(state));
}
Status BlockingJoinNode::open(RuntimeState* state) {
SCOPED_TIMER(_runtime_profile->total_time_counter());
RETURN_IF_ERROR(ExecNode::open(state));
SCOPED_CONSUME_MEM_TRACKER(mem_tracker());
SCOPED_CONSUME_MEM_TRACKER(mem_tracker_growh());
// RETURN_IF_ERROR(Expr::open(_conjuncts, state));
RETURN_IF_CANCELLED(state);