Repository navigation
Conversation
Collaborator
|
Review requested:
|
jasnell
force-pushed
the
heap-pointer-compression-warning
branch
from
November 14, 2026 16:00
b8b33ac to
139e03c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
anonrig
approved these changes
Nov 14, 2026
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67468 +/- ##
==========================================
- Coverage 90.68% 90.67% -0.02%
==========================================
Files 799 799
Lines 280243 280305 +62
Branches 54121 54142 +21
==========================================
+ Hits 254136 254157 +21
- Misses 16221 16274 +53
+ Partials 9886 9874 -12
🚀 New features to boost your workflow:
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
In builds without pointer compression, emit a process warning with the code HEAP_EXCEEDS_POINTER_COMPRESSION_LIMIT when the heap that survives a full garbage collection suggests that it would not fit in the 4 GiB cage that limits the heap of each isolate when pointer compression is enabled. Pointer compression shrinks a heap by at most half, and by about 40% in practice, so the warning says the heap is likely to exceed the limit from 6.5 GiB, and that it will exceed the limit from 8 GiB. The check runs in a GC epilogue callback for mark-compact GCs only, is done at most once per Environment, and unregisters itself after the warning has been scheduled. The warning can be silenced with --disable-warning=HEAP_EXCEEDS_POINTER_COMPRESSION_LIMIT. Assisted-by: Claude Signed-off-by: James M Snell <jasnell@gmail.com>
jasnell
force-pushed
the
heap-pointer-compression-warning
branch
from
November 15, 2026 21:29
139e03c to
ae315f7
Compare
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.
In builds without pointer compression, emit a process warning with the code HEAP_EXCEEDS_POINTER_COMPRESSION_LIMIT the first time the heap that survives a full garbage collection reaches 6.5 GB / 8 GB threshold. With pointer compression enabled, the heap of each isolate is limited to its 4 GB cage, so applications that currently use larger heaps may run out of memory in builds that enable it.
The check runs in a GC epilogue callback for mark-compact GCs only, is done at most once per Environment, and unregisters itself after the warning has been scheduled. The warning can be silenced with --disable-warning=HEAP_EXCEEDS_POINTER_COMPRESSION_LIMIT.
With any luck, the hope is that we can work towards enabling pointer compression by default in releases.
Note: Node.js builds in V8's multi-cage mode, where the main thread and every worker thread is created in it's own Isolate Group. Every Isolate Group has a max 4 GB heap limit. It used to be that the 4 GB limit was process wide, but that's not the case any longer. However, with pointer compression, no single thread can exceed the 4 GB limit, so applications running larger heaps would crash.
Currently, pointer compression has to be turned on at build, with the default build having it off. I'd like to work towards flipping that. Applications running larger-than-4GB heaps should be the exception but we're forcing every application to use more memory than they need to in order to support those exceptions.
For consideration: the warning here may not be entirely accurate yet. An application that hits 4 GB limit today won't actually fail under pointer compression since it will be using less heap... I'm working on refining the heuristic. May be worth holding this PR open until we refine that.Update: Ok, I've updated it so that the warning uses a more accurate threshold... 6.5 GB / 8 GB.