Fix JNI array leaking by freeing the memory after conversion#167
Merged
mkitti merged 1 commit intoJuliaInterop:masterfrom Jul 18, 2023
Merged
Fix JNI array leaking by freeing the memory after conversion#167mkitti merged 1 commit intoJuliaInterop:masterfrom
mkitti merged 1 commit intoJuliaInterop:masterfrom
Conversation
Member
|
Thank you. I will take a look. Also, how well does the master branch work for you? The release process got stalled, but we are due for a breaking release. I'm targeting August 7th for merging and release. Please ping me if not released by then. |
Contributor
Author
|
These are the results when I build and test the repository, see output.txt. I'm running on Julia 1.8.5 and Windows 10. |
Contributor
Author
|
@mkitti What's the status on the release? |
Member
|
I will arrange for it today. |
Member
|
I'm trying to include #165 . Almost there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It was observed that JavaCall was leaking memory when getting arrays of objects from Java. This is due to the fact that arrays from Java are converted into Julia arrays by copying the elements over from the Java array, but the Java array is subsequently not freed from memory, causing a leak as at the end of the Julia code the pointer is garbage collected. In #135 essentially the same leak was fixed, but only for primitive arrays, not arrays of Java objects, etc. This PR aims to solve the issue for the remaining cases.