nextjs - 💡(How to fix) Fix Memory leak causing OOM still occurs in Next.js 16.0.10 (also tested with 16.0.1) when using `output: standalone` with fetch requests. [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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…
GitHub stats
vercel/next.js#90431Fetched 2026-04-08 00:20:09
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1issue_type_added ×1

Code Example

- Platform: Linux
- Node: v22.16.0
- Next.js: 16.0.10
- output: standalone
- Router: App Router
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/vercel/next.js/issues/85914

To Reproduce

  1. Create a Next.js app with output: 'standalone'
  2. Make fetch requests
  3. With just 2 requests per second, OOM occurs after a few minutes

Current vs. Expected behavior

  • Current: Memory continuously grows until OOM after ~2 requests/second. GC cannot release the memory.
  • Expected: Memory should stabilize, GC should work properly, no OOM.

Provide environment information

- Platform: Linux
- Node: v22.16.0
- Next.js: 16.0.10
- output: standalone
- Router: App Router

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

Performance

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

Other (Deployed)

Additional context

Related to PR #88577 (fix for issue #85914). The fix should properly cancel both branches of a tee'd ReadableStream, but the issue still persists in 16.0.10.

Heap Timeline Analysis The heap timeline shows that string and object types are being retained and continuously accumulated. These objects are referenced by cacheController

nextjs-memory-leak.heaptimeline.zip

extent analysis

Fix Summary

The leak is caused by the Next.js internal cacheController keeping both branches of a tee‑ed ReadableStream alive when the app runs in standalone mode.
The quickest way to stop the growth is to disable the built‑in response cache for all outgoing fetch calls (or only the ones that stream large bodies).
If you can upgrade, move to Next 16.0.11+ where the PR #88577 fix is included.
If you

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

nextjs - 💡(How to fix) Fix Memory leak causing OOM still occurs in Next.js 16.0.10 (also tested with 16.0.1) when using `output: standalone` with fetch requests. [2 comments, 3 participants]