This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 8011de551dc branch-4.0: [chore](profile) Fix the memory usage in 
HeapSorter #59252 (#59277)
8011de551dc is described below

commit 8011de551dcead467c18b39f57ef26372c8f6c73
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 23 14:12:43 2025 +0800

    branch-4.0: [chore](profile) Fix the memory usage in HeapSorter #59252 
(#59277)
    
    Cherry-picked from #59252
    
    Co-authored-by: Jerry Hu <[email protected]>
---
 be/src/vec/common/sort/heap_sorter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/be/src/vec/common/sort/heap_sorter.cpp 
b/be/src/vec/common/sort/heap_sorter.cpp
index c1b6a735afd..70307628071 100644
--- a/be/src/vec/common/sort/heap_sorter.cpp
+++ b/be/src/vec/common/sort/heap_sorter.cpp
@@ -42,8 +42,8 @@ Status HeapSorter::append_block(Block* block) {
         if (!current->impl->is_last(current_rows)) {
             _queue.next(current_rows);
         } else {
-            _queue.remove_top();
             _data_size -= current->impl->block->allocated_bytes();
+            _queue.remove_top();
         }
         _queue_row_num -= current_rows;
     }


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

Reply via email to