Skip to content

Memory Leak with ByRef Variant #67

Open
@mkarg

Description

@mkarg

The following code produces an off-heap memory leak (using JACOB-1.18-M3, also tried JACOB-1.21 on x64 / JVM 17):

String f(int h) {
    var r = new Variant("", true);
    try {
        var c = Dispatch.call(this.dispatch, "f", h, r);
        try {
            c.VariantClear();
        } finally {
            c.safeRelease();
        }
        return r.getStringRef();
    } finally {
        try {
            r.VariantClear();
        } finally {
            r.safeRelease();
        }
   }
}

Running in an infinite loop it easily piles up non-GC-able memory within few minutes! Letting it run endless, java.exe consumes Gigabytes after few hours. Apparently somewhere JACOB is leaking off-heap memory! 🙂

Kindly asking for help! 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions