[feature-wip] (memory tracker) (step4) Switch TLS mem tracker to separate more detailed memory usage (#8669)
Based on #8605, Separate out the memory usage of each operator from the Query/Load/StorageEngine mem tracker.
This commit is contained in:
@ -22,7 +22,6 @@
|
||||
#include "exec/exec_node.h"
|
||||
#include "runtime/mem_pool.h"
|
||||
#include "runtime/row_batch.h"
|
||||
#include "runtime/thread_context.h"
|
||||
#include "util/defer_op.h"
|
||||
#include "vec/core/block.h"
|
||||
#include "vec/data_types/data_type_nullable.h"
|
||||
@ -203,15 +202,15 @@ void AggregationNode::_init_hash_method(std::vector<VExprContext*>& probe_exprs)
|
||||
}
|
||||
|
||||
Status AggregationNode::prepare(RuntimeState* state) {
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
RETURN_IF_ERROR(ExecNode::prepare(state));
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_MEM_TRACKER(mem_tracker());
|
||||
_build_timer = ADD_TIMER(runtime_profile(), "BuildTime");
|
||||
_exec_timer = ADD_TIMER(runtime_profile(), "ExecTime");
|
||||
_merge_timer = ADD_TIMER(runtime_profile(), "MergeTime");
|
||||
_expr_timer = ADD_TIMER(runtime_profile(), "ExprTime");
|
||||
_get_results_timer = ADD_TIMER(runtime_profile(), "GetResultsTime");
|
||||
_data_mem_tracker = MemTracker::create_virtual_tracker(-1, "AggregationNode:Data", mem_tracker());
|
||||
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
_intermediate_tuple_desc = state->desc_tbl().get_tuple_descriptor(_intermediate_tuple_id);
|
||||
_output_tuple_desc = state->desc_tbl().get_tuple_descriptor(_output_tuple_id);
|
||||
DCHECK_EQ(_intermediate_tuple_desc->slots().size(), _output_tuple_desc->slots().size());
|
||||
@ -332,9 +331,10 @@ Status AggregationNode::prepare(RuntimeState* state) {
|
||||
}
|
||||
|
||||
Status AggregationNode::open(RuntimeState* state) {
|
||||
RETURN_IF_ERROR(ExecNode::open(state));
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER_ERR_CB("aggregator, while execute open.");
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_MEM_TRACKER(mem_tracker());
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER_ERR_CB("aggregator, while execute open.");
|
||||
RETURN_IF_ERROR(ExecNode::open(state));
|
||||
|
||||
RETURN_IF_ERROR(VExpr::open(_probe_expr_ctxs, state));
|
||||
|
||||
@ -368,8 +368,9 @@ Status AggregationNode::get_next(RuntimeState* state, RowBatch* row_batch, bool*
|
||||
}
|
||||
|
||||
Status AggregationNode::get_next(RuntimeState* state, Block* block, bool* eos) {
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER_ERR_CB("aggregator, while execute get_next.");
|
||||
SCOPED_TIMER(_runtime_profile->total_time_counter());
|
||||
SCOPED_SWITCH_TASK_THREAD_LOCAL_EXISTED_MEM_TRACKER(mem_tracker());
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER_ERR_CB("aggregator, while execute get_next.");
|
||||
|
||||
if (_is_streaming_preagg) {
|
||||
bool child_eos = false;
|
||||
|
||||
Reference in New Issue
Block a user