GeezerVison is showing github.com — [v24.x] deps: V8: backport 2444c109f4f8 by acburdine · Pull Request #66741 · nodejs/node
Conversation
acburdine
commented
Oct 14, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Draft: v24.x backport of v8/v8@2444c10 (https://chromium-review.googlesource.com/c/v8/v8/+/8521518, crbug https://issues.chromium.org/issues/570738027).
Fixes: #66564
Since V8's allocation throughput moved to SmoothedBytesAndDuration (V8 13.1), a throughput of exactly 0 made ComputeMutatorUtilizationImpl() report "maximal allocation". Node never allocates on the CppHeap unless node:vm is used, so Heap::HasLowAllocationRate() was never true and the MemoryReducer could only start a GC through its 100 s watchdog. v24.x (V8 13.6) is affected; v22.x (V8 12.4) is not. Upstream removed the zero special case, so 0 now counts as the lowest allocation rate.
Changes from the upstream commit (same as the v26.x backport):
heap.cc, heap.h, gc-tracer.h: applied unchanged.
deps/v8/AUTHORS: same line, merged by hand.
test/unittests/heap/gc-tracer-unittest.cc: GCTracer::SampleAllocation() takes 4 counters on V8 13.6, so the two new tests drop the external-memory argument.
v8_embedder_string bumped to -node.64.
Verification:
- Node build on macOS arm64 (
v24.22.1-pre, V8 13.6.233.17-node.58); make -j8 test-only: cctest 242/242, JS 5744/5749. The 5 JS failures are environmental: two fs-cp socket tests hit the macOS socket-path length limit (they pass with a short NODE_TEST_DIR), and test-worker-track-unmanaged-fds, test-worker-debug and test-esm-import-meta-main-eval fail identically with the heap.cc change reverted (unmanaged-fd warnings on this macOS version). make test's doc lint step also aborts in libuv (uv__io_poll) on this machine, independent of this change.
- In a linux/amd64 container (V8's standalone toolchain doesn't build against the current macOS SDK; built with
v8_enable_static_roots = false to match Node's gyp config): unittests/GCTracerTest.* and unittests/MemoryReducer.* 25/25 pass. With the heap.cc change reverted, GCTracerTest.LowAllocationRateWithZeroEmbedderAllocation fails (HasLowAllocationRate() is false); with it, both new tests pass.
- Same container, the
make test-v8 suites: 14,141/14,149 pass. All 8 failures are emulation limits of the x86 emulator the container ran under: 5 cctest/test-allocation/*OOM tests (deliberate ~128 TB allocations) and 3 mjsunit tests using --multi-mapped-mock-allocator (mremap with old size 0).
The repro numbers in https://github.com/acburdine/node-memory-reducer-repro were measured on v24.21.0 (100 s / 100 s / 141 s to the first memory-reducer GC vs 11 s with an earlier, embedder-only version of this fix).
Disclaimer
The investigation, the upstream CL and this backport were prepared with help from an AI coding assistant. The fix was reviewed and approved upstream by the V8 heap team; I reviewed the backport diff, and the verification above was run locally on this branch.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
win-tran-covergo, moofity, eliaskoeberl, and IlGigione reacted with thumbs up emoji
|
Review requested:
- @nodejs/gyp
- @nodejs/security-wg
- @nodejs/v8-update
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot
added
build
Issues and PRs related to Node.js builds or CI infrastructure.
needs-ci
PRs that need a full CI run.
v24.x
Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.
v8 engine
Issues and PRs related to the V8 dependency.
labels
Oct 14, 2026
|
Welcome to Node.js, and thank you for your first contribution!
Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Original commit message:
[heap] Treat zero allocation throughput as a low allocation rate
Since https://crrev.com/c/5935313 allocation throughput is tracked with
SmoothedBytesAndDuration, which has no lower bound. A sampled throughput
of exactly 0 -- nothing was allocated, or the smoothed value decayed to
0 after a long idle period -- made ComputeMutatorUtilizationImpl()
return a mutator utilization of 0 ("maximal allocation"). For an isolate
that never allocates on the CppHeap, HasLowAllocationRate() is then
never true and the MemoryReducer cannot start a GC through its
low-allocation condition; only the 100s watchdog can. Node.js hits this
for any process that does not use node:vm.
Remove the special case. A mutator speed of 0 now yields a mutator
utilization of 1, i.e. the lowest possible allocation rate. gc_speed is
either the conservative default or at least 1 byte/ms, so the formula
stays well defined.
Bug: 570738027
Change-Id: I84cd51607df3c31c2f1e02bb2fe258e5506131ce
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8521518
Reviewed-by: Dominik Inführ <[email protected]>
Commit-Queue: Dominik Inführ <[email protected]>
Reviewed-by: Omer Katz <[email protected]>
Commit-Queue: Omer Katz <[email protected]>
Cr-Commit-Position: refs/heads/main@{#110599}
Refs: v8/v8@2444c10
Fixes: nodejs#66564
Assisted-by: Claude Code
Signed-off-by: Austin Burdine <[email protected]>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Just to make sure I understand the process: this fix isn't on main (it'll only arrive there via the V8 15.8 update in #67070), so should #66736 get an lts-watch-v24.x / backport-requested-v24.x label so it's picked up for v24.x? This branch is rebased on current v24.x-staging and conflict-free (the only v24-specific difference is GCTracer::SampleAllocation() taking 4 args in the new tests) if it's useful for that.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
build
Issues and PRs related to Node.js builds or CI infrastructure.
needs-ci
PRs that need a full CI run.
v8 engine
Issues and PRs related to the V8 dependency.
v24.x
Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|