Commit

c9f9542

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 it grows forever. Measured: 2,000 compiles of a slightly different note each time take the heap to 354 MB. With the fix (clear the cache after each compile) it stays flat at 68 MB. Fix: https://github.com/dtinth/notes-frontend/pull/4 (a 4-line change). I was not able to merge it from here. @dtinth can you merge #4? Then I will pin the release here, and after a redeploy the 768 MiB limit should be plenty.
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...

commit c9f9542

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.