Skip to content

Commit

Permalink
branch-3.0: [fix](cross join) fix memory usage counter (#46152) (#46341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacktengg authored Jan 5, 2025
1 parent 9161c05 commit 1e12553
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions be/src/pipeline/exec/nested_loop_join_build_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ Status NestedLoopJoinBuildSinkOperatorX::sink(doris::RuntimeState* state, vector
auto mem_usage = block->allocated_bytes();

if (rows != 0) {
local_state._build_rows += rows;
local_state._total_mem_usage += mem_usage;
COUNTER_UPDATE(local_state._memory_used_counter, mem_usage);
local_state._shared_state->build_blocks.emplace_back(std::move(*block));
if (_match_all_build || _is_right_semi_anti) {
local_state._shared_state->build_side_visited_flags.emplace_back(
Expand Down
2 changes: 0 additions & 2 deletions be/src/pipeline/exec/nested_loop_join_build_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ class NestedLoopJoinBuildSinkLocalState final

private:
friend class NestedLoopJoinBuildSinkOperatorX;
uint64_t _build_rows = 0;
uint64_t _total_mem_usage = 0;

vectorized::VExprContextSPtrs _filter_src_expr_ctxs;
};
Expand Down
1 change: 1 addition & 0 deletions be/src/pipeline/exec/nested_loop_join_probe_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ Status NestedLoopJoinProbeOperatorX::push(doris::RuntimeState* state, vectorized
bool eos) const {
auto& local_state = get_local_state(state);
COUNTER_UPDATE(local_state._probe_rows_counter, block->rows());
COUNTER_SET(local_state._memory_used_counter, (int64_t)block->allocated_bytes());
local_state._cur_probe_row_visited_flags.resize(block->rows());
std::fill(local_state._cur_probe_row_visited_flags.begin(),
local_state._cur_probe_row_visited_flags.end(), 0);
Expand Down

0 comments on commit 1e12553

Please sign in to comment.