Repository navigation
Fit the Node heap to the 1Gi pod limit - #8
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
lolgab
marked this pull request as ready for review
December 3, 2026 10:52
lolgab
enabled auto-merge (squash)
December 3, 2026 10:52
There was a problem hiding this comment.
Pull Request Overview
✅ No blocking issues noticed
No blocking findings were identified.
Test suggestions
- Verify the entrypoint invokes Node with the reduced old-space and semi-space flags.
- Run the wrapper against large oxlint JSON output and verify it completes without exceeding the pod memory budget.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the entrypoint invokes Node with the reduced old-space and semi-space flags.
2. Run the wrapper against large oxlint JSON output and verify it completes without exceeding the pod memory budget.
TIP Add review instructions in .codacy/instructions/review.md, or an AGENTS.md, so the reviewer knows your conventions.
TIP How was this review? Give us feedback
DMarinhoCodacy
approved these changes
Dec 3, 2026
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.
entrypoint.shlets the Node wrapper grow its old space to 4608 MiB, with 128 MiB semi-spaces on top (V8 sizes the young generation at 3× the semi-space, so up to 384 MiB), in a pod with a 1Gi memory limit that also has to fit the oxlint process. V8 sees no memory pressure until far past the limit, so the kernel kills the pod first.--max-old-space-size--max-semi-space-sizeThe wrapper's largest allocation is oxlint's JSON output:
spawnSyncbuffers up to 100 MB (maxBuffer), then it is turned into a string and parsed. Locally (Node, a synthetic 100 MB oxlint JSON with 250k diagnostics run through the samespawnSync+JSON.parse+ emit loop):So 512 MiB covers the worst output the wrapper accepts with about 2× headroom over the live heap, and leaves the rest of the 1Gi for oxlint while it runs (about 210 MiB RSS single-threaded on TypeScript's
lib/*.js). If the heap still runs out, Node fails with a heap error instead of the pod being OOM-killed.Related: #7 (oxlint
--threads 1).plugins_test)ToolOutOfMemorycount vs before