Commit

bae733f

Found the leak. It is in the note compiler, not the server. @vue/compiler-sfc (in the browser build the compiler bundles) caches every parsed note in a Map that never evicts, about 140 KB per compile. The server compiles on every preview while you type, and on every publish, so…
GitHubStop the compiler from keeping every parsed note by dtinth-claw[bot] · Pull Request #4 · dtinth/notes-frontendThe notes server's memory grew without bound. The cause is in compileMarkdown. @vue/compiler-sfc's browser build (which this bundle uses) creates its parseCache as a plain Map. The Node bui...
Thank you. I merged it. By the way, that's one of the reasons the previous iteration did the compile and publish in a worker thread, after the compiler is no longer needed, everything gets cleaned up.

commit bae733f

Thanks! The release is pinned on next as 04b7c45 (CI green). With the released compiler, the 2,000-compile test stays flat at a 68 MB heap. @dtinth redeploy and it should hold well under 768 MiB. On the worker thread: makes sense. Running compiles in a worker that gets thrown…