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

   Just created this PR for cookbook, I would appreciate it if you could help 
me validate the notes mentions 
    https://github.com/apache/arrow-cookbook/pull/325
   
   ```
       For Python Consumer and Java Producer, please consider:
   
       - The Root Allocator should be shared for all memory allocations.
   
       - The Python application will sometimes shut down the Java JVM but Java 
JNI C Data will still work on releasing exported objects, which is why some 
guards have been implemented to protect against such scenarios. A warning 
message "WARNING: Failed to release Java C Data resource" indicates this 
scenario.
   
       - We do not know when Root Allocator will be closed. It is for this 
reason that the Root Allocator should survive so long as the export/import of 
used objects is released. Here is an example of this scenario:
   
           + Whenever Java code calls `allocator.close`, a memory leak will 
occur since many objects will have to be released on either Python or Java JNI 
sides.
   
           + To solve memory leak problems, you will call Java 
`allocator.close` when Python and Java JNI have released all their objects, 
which is impossible to accomplish.
   
       - In addition, Java applications should expose a method for closing all 
Java-created objects independently from Root Allocators.
   
   ```


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