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



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to