Tinymist using more than 30gb of RAM on a reasonable size project

Regarding both tinymist and fletcher, this has been discussed before, which might be interesting: Why does Fletcher seem to be using a lot of RAM and CPU when incrementally compiling with tinymist? - #9 by Myriad-Dreamin

This is no solution, just to explain: If you turn off tinymist - completely - and work with `typst watch`, after a few recompiles it will most likely show the same high memory usage (note here that it depends on what you change between edits, and how many recompile cycles). That would be a confirmation that the problem is with the in-memory caching for incremental compilation, which is a core typst feature (which tinymist takes advantage of by including the typst compiler).

For any programming people, when typst says incremental compilation, it’s entirely in-memory, which is surprising compared with for example compiling Rust. So incremental compilation mostly comes into play when using `typst watch` or `tinymist` (simplification).

How fletcher is implemented still has an impact of course. I would guess that any package drawing typst native graphics would have similar challenges, though.

As mentioned in that thread, a possible workaround would be to move fletcher diagram compilation to a separate step, so that they are just included as finished graphics into the main document (PDF or SVG possible).

Related issue: