Repository navigation
feat: bound what the TypeScript check's worker may hold with memoryLimit - #386
alexander-akait wants to merge 2 commits into
Conversation
The worker a TypeScript check runs on held as much as Node gives a thread, and a runaway program had nothing to stop it short of that. `memoryLimit` (MB, at least 16) is handed to the worker as `maxOldGenerationSizeMb`. Over it, jest-worker rejects the run; the check reports the limit, drops the worker, and the next build starts the program from nothing. Below 16 MB V8 cannot start the thread at all and ends the process, hence the minimum. It bounds memory rather than saving it: 301 files peaked at 588 MB without a limit, 555 MB under 512 MB at +10% time, and ran out under 160 MB, as reported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01App18sYbe6Vf6HDCjCXbvf
One or more co-authors of this pull request were not found. You must specify co-authors in commit message trailer via: Supported
Alternatively, if the co-author should not be included, remove the Please update your commit message(s) by doing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #386 +/- ##
==========================================
+ Coverage 99.62% 99.64% +0.01%
==========================================
Files 19 19
Lines 5400 5649 +249
==========================================
+ Hits 5380 5629 +249
Misses 20 20 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
WalkthroughThe TypeScript check now accepts an optional worker memory limit in megabytes, with a minimum of 16. The checker passes the limit to the worker’s heap configuration. After worker errors, the checker removes and ends the worker; memory-exhaustion errors receive a specific message that retains the original error as its cause. The README and changeset describe the option, and a test covers limited and unrestricted worker runs. Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
60f54a48-b910-4428-9e6d-b822b15ac629
📒 Files selected for processing: 8
.changeset/ts-memory-limit.mdREADME.mdsrc/checks/typescript.check.jssrc/checks/typescript.jssrc/checks/typescript.jsonsrc/threads.jstest/typescript/threads.test.jstypes/threads.d.ts
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01App18sYbe6Vf6HDCjCXbvf
|
EasyCLA fails because the commits carry a Generated by Claude Code |
Part of the performance series (#376–#385). This one bounds memory rather than saving it.
Problem
The TypeScript check's worker thread could hold as much heap as Node gives a thread, and nothing capped it. fork-ts-checker-webpack-plugin sets a
memoryLimit(default 2048 MB, as--max-old-space-sizeon its process), and ts-checker-rspack-plugin defaults to 8192 MB.Change
memoryLimit(MB, minimum 16). It's handed to the worker asresourceLimits.maxOldGenerationSizeMb; jest-worker 30.5 forwards it.memoryLimitlets its worker hold: raise it, or setskipLibCheckto check less";Measured
301 files, TypeScript check on its worker, one-shot:
memoryLimitNear the limit the collector works harder, so this is for keeping a runaway program from taking the build down, not for speed. The README says so.
Tests
test/typescript/threads.test.js): withmemoryLimit: 16, the check reports the limit, and the next build without it reports the usual TS2322. With the option not handed to the worker, this test fails. It's skipped where there's no thread to spare, since the check then runs on webpack's thread, which the limit isn't for.eslint,tsc, prettier, cspell andlint:schemaare clean.Generated by Claude Code
Summary by CodeRabbit