← Back to Pull requests

src: warn when heap would exceed pointer compression limit #67468

Closed
unknown closed this pull request without merging on Nov 16, 2026 15:54 UTC
View on GitHub
unknown unknown commented on Nov 14, 2026 15:46 UTC
Author

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.

Diff: 234 lines (+175 / -59) across 2 files Reviewer: anonrig Review duration: 2888m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 234 lines diff across 2 files
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.327
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #67468"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 37.1% (MEDIUM) · Higher = larger blast radius
37.1%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 14.7% · Safe to merge
14.7%
Repository