fix(api): stop README render memory leak (jsdom DOMPurify → sanitize-html) - #14
Merged
Merged
Conversation
…EADME render memory leak isomorphic-dompurify runs on jsdom under Bun and leaks ~1 MiB per sanitize() call. Every 10-minute README cache expiry re-rendered all plugins, growing the registry pod by ~40 MiB until the kernel OOM-killed it at the 512Mi limit (124 restarts in 2 days). sanitize-html (htmlparser2, no DOM) uses the same tag/attribute allowlist, keeps shiki inline styles, and plateaus at ~100 MiB over 3000 renders. Adds a sanitization + memory regression test. Bumps api to 0.14.2.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registry pod was OOMKilled every ~25 min since 0.14.1 (124 restarts). Root cause: isomorphic-dompurify on jsdom leaks ~1 MiB per sanitize() under Bun; each 10-min README cache expiry added ~40 MiB.
Verified locally: 490 tests pass, tsc clean, 3000 renders plateau at ~100 MiB.