sandeshkr419 opened a new pull request, #1240:
URL: https://github.com/apache/arrow-java/pull/1240
`ReferenceCountedArrowArray.unsafeAssociateAllocation` calls `retain()`
before `wrapForeignAllocation`. If `wrapForeignAllocation` throws (allocator
over its limit), the retain is never balanced, the reference count stays
elevated, and the C Data release callback never fires — leaking the producer's
native memory.
**Fix:** call `retain()` after `wrapForeignAllocation` returns. Same
behavior on the success path; on failure the existing `finally` in
`ArrayImporter.importArray` drives the count to zero and fires the release
callback.
**Test:** `ImportOutOfMemoryTest` — exports a batch from a "producer"
allocator, tries to import it into a too-small consumer, and asserts the
producer drains to zero after the OOM. Fails on the original code, passes with
the fix.
Fixes: 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]