nextjs - 💡(How to fix) Fix Memory leak on node.js v26.2

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

<--- Last few GCs --->

[74818:0x2b239000] 2405592 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 15948.13 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested [74818:0x2b239000] 2421790 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 16197.31 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory ----- Native stack trace -----

1: 0x81353b node::OOMErrorHandler(char const*, v8::OOMDetails const&) [next-server (v16.2.6)] 2: 0xc41f7b [next-server (v16.2.6)] 3: 0xeb2675 [next-server (v16.2.6)] 4: 0xeb141d [next-server (v16.2.6)] 5: 0xea37bc [next-server (v16.2.6)] 6: 0xea30cf [next-server (v16.2.6)] 7: 0xe7f25d [next-server (v16.2.6)] 8: 0x133d838 [next-server (v16.2.6)] 9: 0x74c613e7ea76

Code Example

<--- Last few GCs --->

[74818:0x2b239000]  2405592 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 15948.13 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested
[74818:0x2b239000]  2421790 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 16197.31 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x81353b node::OOMErrorHandler(char const*, v8::OOMDetails const&) [next-server (v16.2.6)]
 2: 0xc41f7b  [next-server (v16.2.6)]
 3: 0xeb2675  [next-server (v16.2.6)]
 4: 0xeb141d  [next-server (v16.2.6)]
 5: 0xea37bc  [next-server (v16.2.6)]
 6: 0xea30cf  [next-server (v16.2.6)]
 7: 0xe7f25d  [next-server (v16.2.6)]
 8: 0x133d838  [next-server (v16.2.6)]
 9: 0x74c613e7ea76

---

OS: Ubuntu 24.04
Node.js: v26.2
Next.js: v16.2.6
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

private code

To Reproduce

Run a next.js server in dev mode. npm run dev

Current vs. Expected behavior

<--- Last few GCs --->

[74818:0x2b239000]  2405592 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 15948.13 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested
[74818:0x2b239000]  2421790 ms: Mark-Compact (reduce) 29794.3 (32029.3) -> 29794.3 (32029.3) MB, pooled: 0.0 MB, 16197.31 / 0.00 ms (average mu = 0.001, current mu = 0.000) last resort; GC in old space requested

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0x81353b node::OOMErrorHandler(char const*, v8::OOMDetails const&) [next-server (v16.2.6)]
 2: 0xc41f7b  [next-server (v16.2.6)]
 3: 0xeb2675  [next-server (v16.2.6)]
 4: 0xeb141d  [next-server (v16.2.6)]
 5: 0xea37bc  [next-server (v16.2.6)]
 6: 0xea30cf  [next-server (v16.2.6)]
 7: 0xe7f25d  [next-server (v16.2.6)]
 8: 0x133d838  [next-server (v16.2.6)]
 9: 0x74c613e7ea76

Provide environment information

OS: Ubuntu 24.04
Node.js: v26.2
Next.js: v16.2.6

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

It seems OK on node.js v26.1.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING