HaxeFoundation / HaxeFoundation/haxe
Macro interpreter memory leak, up to 24GB RAM usage observed
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
When compiling a macro heavy project with vscode, we observed that `haxe.exe` 's memory usage grows quickly at each compile (and diagnostic) when the source is modified. It grow easily up to 24 GB before display memory details and 10 GB after display (there is a Ocaml GC call inside `get_memory_json`) which freeze the system. Restarting language server reset the cache size but does not stay for long (devs are restarting very regularly now 😭).
We suspect memory leak in macro interpreter. With some additional tracing on each variable of "macro interpreter", it shows the following result (knowing that after ocaml GC, the total cache size after the first build is less than 400MB, and average usage of another projects is around 1.5GB):

Contributor guide
Assessment
This issue has not been assessed yet.