wecharyu opened a new issue, #13627:
URL: https://github.com/apache/gluten/issues/13627

   ### Backend
   
   VL (Velox)
   
   ### Bug description
   
   When `WholeStageResultIterator::spillFixedSize(size)` is called with enough 
free pool capacity, the initial `memoryManager_->shrink(size)` can satisfy or 
exceed the reclaim target.
   
   With `spillStrategy=auto`, the method still passes `remaining = size - 
shrunken` to `arbitrator()->shrinkCapacity(remaining)`:
   
   - When `remaining == 0`, it requests reclamation of all reclaimable memory.
   - When `remaining < 0`, conversion to `uint64_t` produces a very large 
reclaim target.
   
   This can unnecessarily reclaim used memory and trigger spilling after the 
original target has already been met.
   
   Expected behavior:
   Return the actual shrunken capacity immediately when `shrunken >= size`.
   
   ### Gluten version
   
   main branch
   
   ### Spark version
   
   None
   
   ### Spark configurations
   
   _No response_
   
   ### System information
   
   _No response_
   
   ### Relevant logs
   
   ```bash
   
   ```


-- 
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