[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:
Xinyi Zou
2022-04-08 09:02:26 +08:00
committed by GitHub
parent 7fb4b6a6e2
commit 519305cb22
79 changed files with 378 additions and 150 deletions

View File

@ -23,7 +23,6 @@
#include "gen_cpp/PlanNodes_types.h"
#include "runtime/row_batch.h"
#include "runtime/runtime_state.h"
#include "runtime/thread_context.h"
#include "util/debug_util.h"
#include "util/runtime_profile.h"
@ -35,6 +34,7 @@ CrossJoinNode::CrossJoinNode(ObjectPool* pool, const TPlanNode& tnode, const Des
Status CrossJoinNode::prepare(RuntimeState* state) {
DCHECK(_join_op == TJoinOp::CROSS_JOIN);
RETURN_IF_ERROR(BlockingJoinNode::prepare(state));
SCOPED_SWITCH_TASK_THREAD_LOCAL_MEM_TRACKER(mem_tracker());
_build_batch_pool.reset(new ObjectPool());
return Status::OK();
}
@ -89,6 +89,7 @@ Status CrossJoinNode::get_next(RuntimeState* state, RowBatch* output_batch, bool
// TOOD(zhaochun)
// RETURN_IF_ERROR(state->check_query_state());
SCOPED_TIMER(_runtime_profile->total_time_counter());
SCOPED_SWITCH_TASK_THREAD_LOCAL_EXISTED_MEM_TRACKER(mem_tracker());
if (reached_limit() || _eos) {
*eos = true;