hu6360567 commented on issue #36443:
URL: https://github.com/apache/arrow/issues/36443#issuecomment-1688337506

   > The only problem is the lifetime of the BufferAllocator which isn't 
solvable in C Data Interface; either the Java application needs to have a 
singleton allocator or (preferably) it should tie the lifetime of the allocator 
to something else (e.g. an init/finalize call, or if the Java application 
implements a reader or some other object, it should tie the allocator to that 
object)
   
   It cannot use a very close lifetime scoped `BufferAllocator`, since the 
python gc is not very reliable. We are using a sapaterate allocator for export 
streams that outlives themselves.
   When record_batch at python side is garbage collected, it will make a 
callback to the owner to release. But it not always as expected, since there is 
no RAII like object to live as long as a `with` statement, you may check 
earlier discussion in mailing list.
   https://lists.apache.org/thread/glog4g0gkm1c7lz7nx6opso7d97sot49


-- 
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]

Reply via email to