Open
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
See this comment #6363 (comment),
when the Buffer
's data is shared between many Buffer
, the capacity()
method will always return the total buffer memory usage, which causes the issue #6363, we need discussion the better memory track for shared buffers.
arrow-rs/arrow-buffer/src/buffer/immutable.rs
Lines 166 to 168 in d05cf6d
Describe the solution you'd like
The easy way to do this is to return the length and the unused capacity of the Buffer
like pr #6438,
pub fn capacity(&self) -> usize {
self.length + self.data.capacity() - self.data.len()
}
This is changing what these methods report to something else that I'm not sure is correct. Whilst this formulation may benefit your use-case, there are common situations where it will now under report... Perhaps you might file a ticket to discuss a memory tracking approach that better handles shared buffers, as that is the actual issue here. This is not a bug
Originally posted by @tustvold in #6438 (comment)
But as @tustvold said, we need more discussion.
Describe alternatives you've considered
Additional context