Commit

a08e5e4

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.
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 away when idle would also cover the ~3 KB per compile that is still left, plus any future leak in the compiler stack. Want me to do that too, or keep it simple now that the main leak is gone? <!-- Suggested quick replies: - Yes, use a worker. - Keep it simple for now. -->

commit a08e5e4