ariel-miculas commented on PR #22416:
URL: https://github.com/apache/datafusion/pull/22416#issuecomment-4520956360

   For the record, this is the issue that I was trying to fix using 
shrink_to_fit:
   Say you have a vector of 1 million elements and you keep taking 1024 
elements from it. Each slice will have a capacity of 1024 except the last one, 
when instead of drain + collect, split_off + mem::replace will be called, since 
the length of the original Vec will have reached 1024. The capacity of the last 
slice will be 1 million, because the capacity of the original Vec doesn't 
change after split_off. This leads to problems with memory accounting.


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