Skip to content

In a concurrent scenario, we need deterministic resource release! #110

@yk-liang

Description

@yk-liang

In a concurrent scenario, I'm creating multiple parsers on a single machine to parse files from multiple repositories, but this causes errors, and I suspect there might be a memory leak. Could you provide a close interface to manually release TSTree and TSParser, similar to this: https://github.com/seart-group/java-tree-sitter.

I understand that in tree-sitter-ng, ts_tree_delete and ts_parser_delete will be called when the object is garbage collected by the JVM. However, this release timing is "non-deterministic"—when GC is triggered and when cleanup actions are executed are both decided by the JVM.

I need deterministic resource release (for example, in a long-running server with frequent creation of syntax trees).

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