-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Java] Memory allocation alignment #36400
Comments
I think it'd be possible & reasonable to (add a mode where) over-allocate by 64 bytes and then use the aligned subset of the buffer. That's what Arrow C++ actually does when using libc malloc. I'd have to look more deeply into Netty to see what it does though. Was your Java application using the Netty allocator or the "unsafe" allocator? |
We use |
Note that we will probably rely on new arrow-rs API to do re-align for unaligned buffers imported from Java Arrow. So this might be not a blocker for us anymore. But as there will be some overhead when re-aligning buffers, ideally I think it would be great if Java Arrow can do memory alignment. |
Ping @davisusanibar |
Describe the bug, including details regarding any error messages, version, and platform.
We see memory alignment error when passing arrays allocated using Java arrow to Rust arrow. This is due to strict memory alignment requirement (apache/arrow-rs#4431) at Rust side. I have described the issue there.
So as it looks like it is impossible to access unaligned memory pointers at Rust side. I'm wondering if we could change Java arrow on memory allocation? Could we allocate memory with alignment for arrays in Java arrow so it could be safely sent to other arrow ecosystems?
Component(s)
Java
The text was updated successfully, but these errors were encountered: