Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JNI array leaking by freeing the memory after conversion #167

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

satanja
Copy link
Contributor

@satanja satanja commented Jul 17, 2023

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.

@mkitti
Copy link
Member

mkitti commented Jul 17, 2023

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.

@satanja
Copy link
Contributor Author

satanja commented Jul 17, 2023

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.

@mkitti mkitti merged commit d7f3136 into JuliaInterop:master Jul 18, 2023
8 of 10 checks passed
@satanja
Copy link
Contributor Author

satanja commented Aug 14, 2023

@mkitti What's the status on the release?

@mkitti
Copy link
Member

mkitti commented Aug 14, 2023

I will arrange for it today.

@mkitti
Copy link
Member

mkitti commented Aug 15, 2023

I'm trying to include #165 . Almost there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants