How to stop typst from consuming increasing RAM for a long running watch process?

I watch a PDF which I am working on. At the start it consumes around 600 MB RAM bit as time passes it starts consuming increasing amount of RAM. I have to restart the process periodically. The PDF is around 160 pages long. I am not sure if this is the right place to ask or whether I should create an issue on github.

1 Like

What you see is probably expected behavior: Typst uses memoization (caching the result of function calls) to allow for instant preview but that also means increasing memory use for long running watch sessions. See this blog post for some details: What If LaTeX Had Instant Preview? | Laurenz's Blog

There is already an issue relevant to the problem of excessive memory usage: Ability to selectively disable memoization · Issue #6508 · typst/typst · GitHub

2 Likes