Repository navigation
Conversation
Collaborator
|
Review requested:
|
rudolf
force-pushed
the
fix/worker-resource-limits-max-old-space-size
branch
from
November 17, 2026 14:40
fba3a0e to
fbfc7f1
Compare
Handle --max-old-space-size in PerIsolateOptions and apply it via v8::ResourceConstraints::set_max_old_generation_size_in_bytes() instead of setting the process-global v8_flags.max_old_space_size flag (unless --max-heap-size is also passed). Workers without an explicit resourceLimits.maxOldGenerationSizeMb continue to inherit the parent isolate's --max-old-space-size (and report that inherited limit on worker.resourceLimits), while workers with an explicit resourceLimits.maxOldGenerationSizeMb or worker execArgv can override it. Fixes: nodejs#67014 Refs: nodejs#43991 Signed-off-by: Rudolf Meijering <skaapgif@gmail.com>
rudolf
force-pushed
the
fix/worker-resource-limits-max-old-space-size
branch
from
November 17, 2026 15:13
fbfc7f1 to
aa6c656
Compare
rudolf
marked this pull request as ready for review
November 17, 2026 15:14
Signed-off-by: Rudolf Meijering <skaapgif@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67544 +/- ##
==========================================
- Coverage 90.67% 90.66% -0.01%
==========================================
Files 800 800
Lines 281081 281129 +48
Branches 54314 54314
==========================================
+ Hits 254870 254890 +20
- Misses 16312 16322 +10
- Partials 9899 9917 +18
🚀 New features to boost your workflow:
|
jasnell
approved these changes
Nov 18, 2026
Collaborator
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.
Currently,
--max-old-space-size(and--max-old-space-size-percentage) sets V8's process-globalv8_flags.max_old_space_size, whichHeap::ConfigureHeapapplies after per-isolatev8::ResourceConstraints. As a result, setting--max-old-space-sizefor the main process silently overridesresourceLimits.maxOldGenerationSizeMbon every Worker thread.This PR handles
--max-old-space-sizeinPerIsolateOptionsand applies it to isolates viav8::ResourceConstraints::set_max_old_generation_size_in_bytes()instead of the globalv8_flagsoverride (unless--max-heap-sizeis also passed, which requires V8's flag handling for young-generation derivation).resourceLimits.maxOldGenerationSizeMbcontinue to inherit the parent isolate's--max-old-space-sizelimit, andworker.resourceLimits.maxOldGenerationSizeMbnow accurately reports that inherited limit.resourceLimits.maxOldGenerationSizeMbor workerexecArgvhave their per-worker limit respected.We need to decide if this behavior change is a bug fix or needs a semver major.
Fixes: #67014
Refs: #43991
Assisted-by: a closed-source coding agent