Skip to content

Conversation

@waynexia
Copy link
Member

Which issue does this PR close?

Follow-up of #6590.

Closes #7151.

Rationale for this change

Add MemoryPool under arrow-buffer/pool feature gate. This pool can implement precise memory tracking for Array/Bytes/MutableBuffer etc. Even in a shared buffer. Design credit to @tustvold

What changes are included in this PR?

New feature gate arrow-buffer/pool.

New traits MemoryPool and MemoryReservation.

New structs TrackingMemoryPool which implements MemoryPool for tracking memory usage.

Corresponding new API claim for Buffer/MutableBuffer/Bytes.

Are there any user-facing changes?

Above new feature and APIs.

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 18, 2025
@waynexia
Copy link
Member Author

cc @jhorstmann @alamb from previous discussion

Copy link
Contributor

@Dandandan Dandandan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this.

@Dandandan
Copy link
Contributor

I think this is a nice API that could be used for more precise memory tracking in DataFusion (which is really missing at this point).

@waynexia
Copy link
Member Author

waynexia commented Jul 8, 2025

Thank you @Dandandan, I'm going to merge this tomorrow if there are no other comments ❤️

@waynexia waynexia merged commit 55865d3 into apache:main Jul 10, 2025
27 checks passed
@waynexia waynexia deleted the memory-pool branch July 10, 2025 17:00
@waynexia
Copy link
Member Author

Thank you ❤️

@alamb
Copy link
Contributor

alamb commented Jul 11, 2025

🚀

@alamb
Copy link
Contributor

alamb commented Jul 11, 2025

Thanks @waynexia and @Dandandan

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed an epic to try and organize this work

[package.metadata.docs.rs]
all-features = true

[features]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to also document this feature flag on the crate page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory consumption grows for interleave kernel when input is StringViewArray

3 participants