You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory leak: parser state grows across parses #137
The Parser instance is cached per thread (Jsonata.getParser() uses a ThreadLocal) and reused for every expression that is parsed on that thread. However, parse() does not reset the parser's per-parse state:
ancestry (list of parent % symbols) keeps growing with every parsed expression that uses the parent operator
ancestorIndex / ancestorLabel keep counting up
errors accumulates across parses
In long-running applications that parse many expressions, ancestry grows without bound and keeps old AST nodes reachable.
In the JS reference implementation these are local to each parser invocation (parser.js), so they should be reset at the start of each parse() call.
Activity