jacktengg commented on code in PR #41602: URL: https://github.com/apache/doris/pull/41602#discussion_r1794450578
########## be/src/pipeline/exec/exchange_sink_operator.cpp: ########## @@ -517,6 +539,11 @@ Status ExchangeSinkOperatorX::sink(RuntimeState* state, vectorized::Block* block RETURN_IF_ERROR(channel_add_rows_with_idx( state, local_state.channels, local_state.channels.size(), assignments, block, eos)); + int64_t new_channel_mem_usage = 0; + for (const auto& channel : local_state.channels) { + new_channel_mem_usage += channel->mem_usage(); + } + local_state.memory_used_counter()->update(new_channel_mem_usage - old_channel_mem_usage); Review Comment: 这里需要用`update`,不能直接`set`,因为`ExchangeSinkBuffer::add_block`里面会对counter进行`update`,这里如果直接set,counter的结果就不对了。 -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org