You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "sandeshkr419 (via GitHub)" <gi...@apache.org> on 2026/07/20 22:22:13 UTC

[I] C Data import leaks native memory when the allocator runs out of space mid-import [arrow-java]

sandeshkr419 opened a new issue, #1239:
URL: https://github.com/apache/arrow-java/issues/1239

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   When importing a C Data array into a BufferAllocator that hits its limit part-way through a multi-buffer array, the producer's native memory leaks permanently.
   
   The bug is in [ReferenceCountedArrowArray.unsafeAssociateAllocation](https://github.com/apache/arrow-java/blob/main/c/src/main/java/org/apache/arrow/c/ReferenceCountedArrowArray.java#L67): it increments the reference count before calling wrapForeignAllocation. If wrapForeignAllocation throws (allocator over limit), **nothing decrements that count**, so the C Data release callback never fires.
   
   **Fix**: move `retain()` to after wrapForeignAllocation succeeds.


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] C Data import leaks native memory when the allocator runs out of space mid-import [arrow-java]

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou closed issue #1239: C Data import leaks native memory when the allocator runs out of space mid-import
URL: https://github.com/apache/arrow-java/issues/1239


-- 
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: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org