Skip to content

Possible memory leak in convert_result #134

@ahnlabb

Description

@ahnlabb

BioformatsLoader.jl has had some problems with OOM-errors. I just added a workaround using local frames (ahnlabb/BioformatsLoader.jl@4d4e2d5). However, it seems like this could be a bigger issue with the result variable in convert_result, it is unclear to me when that local reference is deleted (it is not made into a JavaObject and does not have the deleteref finalizer) and the memory leak issues in BioformatsLoader.jl are fixed if an explicit JNI.DeleteLocalRef(result) is added as in ahnlabb/JavaCall.jl@94289c5 (potentially relevant SO question).

If you think this is indeed the correct approach I can open a PR from ahnlabb/JavaCall.jl@94289c5.

As an aside, BioformatsLoader could possibly benefit from increased control over the byte array life cycle and passing raw byte[] references to Java (as is discussed in #83).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions