JuliaInterop / JavaCall.jl

Call Java from Julia
http://juliainterop.github.io/JavaCall.jl
Other
118 stars 53 forks source link

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

Closed satanja closed 11 months ago

satanja commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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.

satanja commented 10 months ago

@mkitti What's the status on the release?

mkitti commented 10 months ago

I will arrange for it today.

mkitti commented 10 months ago

I'm trying to include https://github.com/JuliaInterop/JavaCall.jl/pull/165 . Almost there.