Skip to content

fix(parser-adapter-yaml-1-2): free WASM tree memory between parses#5152

Open
robert-hebel-sb wants to merge 1 commit intomainfrom
fix/yaml-parser-wasm-memory-leak
Open

fix(parser-adapter-yaml-1-2): free WASM tree memory between parses#5152
robert-hebel-sb wants to merge 1 commit intomainfrom
fix/yaml-parser-wasm-memory-leak

Conversation

@robert-hebel-sb
Copy link
Copy Markdown
Contributor

Summary

  • Free the previous web-tree-sitter Tree via tree.delete() before parsing a new source in the YAML 1.2 lexical analyzer
  • Without this, each call to parser.parse() allocates a new tree on the WASM heap while the old one is never freed, eventually causing a RuntimeError: Aborted() crash

Test plan

  • npm run test in apidom-parser-adapter-yaml-1-2 — all 125 tests passing
  • Verify the "given valid YAML 1.2 with more than 32768 lines" test passes without WASM abort

🤖 Generated with Claude Code

Delete the previous tree-sitter Tree before parsing a new source to
prevent WASM heap exhaustion. Without this, repeated calls to parse
leak WASM memory and eventually abort with a RuntimeError.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robert-hebel-sb robert-hebel-sb added the bug Something isn't working label Mar 27, 2026
@robert-hebel-sb robert-hebel-sb self-assigned this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant