test(profiling): bump OOM extension size to 20MB for Node 22+ headroom#8564
Conversation
… 22+ The "sends a heap profile on OOM with external process and exits successfully" test consistently fails on Node 22.22.3 on Linux. With 3 extensions of 15MB each (50MB initial + 45MB), V8 finishes the test program's 12 x 5MB allocations only by a narrow margin. On Node 22's V8, the GCs running under tight-heap pressure trigger V8's separate "Ineffective mark-compacts near heap limit" abort path (independent of the near-heap-limit callback) before the program completes. Raising each extension to 20MB gives V8 more breathing room between OOM events, making individual GCs more likely to be "effective" and keeping V8's consecutive-ineffective-GC counter from reaching its threshold. The test still exercises 3 OOM events; only the per-step size changes.
|
Overall package sizeSelf size: 5.84 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.0.1 | 82.56 kB | 817.39 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-05-20 10:48:01 Comparing candidate commit 5be3544 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 1499 metrics, 94 unstable metrics. |
Summary
DD_PROFILING_EXPERIMENTAL_OOM_HEAP_LIMIT_EXTENSION_SIZEfrom 15MB to 20MB in thesends a heap profile on OOM with external process and exits successfullyintegration test.Root cause
On Node 22.22.3 on Linux, V8 aborts with
FATAL ERROR: Ineffective mark-compacts near heap limit(not the more familiarReached heap limit). That's a separate V8 abort path inHeap::CheckIneffectiveMarkCompact: after 4 consecutive Mark-Compacts that fail to reclaim "enough" memory, V8 callsFatalProcessOutOfMemory— independently of the near-heap-limit callback. Extending the heap limit doesn't reset the ineffectiveness counter.The OOM test program allocates 12 × 5MB = 60MB into a
leakarray under--max-old-space-size=50. With 3 × 15MB extensions, the final budget is 95MB. On Node 18/20 V8's GCs happen to stay "effective" enough to finish; on Node 22's V8 they don't, and the ineffective-GC counter reaches its threshold before the 12 allocations complete.Why this fix
Raising the per-extension size to 20MB gives V8 more breathing room between OOM events. With more headroom per step, some GCs land in "comfortable" mode, are effective, and reset the consecutive-ineffective counter.
Alternatives considered:
The test still exercises 3 OOM events (50 → 70 → 90 → 110MB), so coverage of the multi-OOM recovery path is preserved.
Test plan