yiguolei commented on code in PR #44185: URL: https://github.com/apache/doris/pull/44185#discussion_r1846265896
########## be/src/vec/exec/scan/scanner_context.cpp: ########## @@ -232,9 +232,21 @@ vectorized::BlockUPtr ScannerContext::get_free_block(bool force) { // The caller of get_free_block will increase the memory usage update_peak_memory_usage(-block->allocated_bytes()); } else if (_block_memory_usage < _max_bytes_in_queue || force) { - _newly_create_free_blocks_num->update(1); - block = vectorized::Block::create_unique(_output_tuple_desc->slots(), 0, - true /*ignore invalid slots*/); + Status status; + if (!force && _state->enable_reserve_memory()) { + status = thread_context()->try_reserve_memory(block_avg_bytes); + if (!status.ok()) { Review Comment: reserve 之后,应该需要release reserverd 应该使用defer 那些macros DEFER_RELEASE_RESERVED -- 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