nextjs - 💡(How to fix) Fix PR #88577 fixes memory leak in canary but has not been backported to stable (16.2.2) [2 comments, 2 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#92439Fetched 2026-04-08 02:59:57
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
commented ×2closed ×1issue_type_added ×1labeled ×1

Fix Action

Fix / Workaround

We cannot test on canary in production (ECS/Docker environment). However, PR #88577 was merged into canary on Feb 10, 2026, and issue #90898 confirmed it was fixed in 16.2.0-canary.79.

Code Example

npx next info
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/Tib-Gridello/nextjs-memory-leak-repro

To Reproduce

  1. Create a Next.js app with output: 'standalone'
  2. Make fetch requests to an external API
  3. docker build -t nextjs-leak .
  4. docker run -p 3000:3000 --memory=4g nextjs-leak
  5. Send traffic to the app
  6. Memory continuously grows until OOM

Current vs. Expected behavior

Current: Memory continuously grows until OOM on [email protected] (stable) with output: standalone. Expected: Memory should stabilize after requests complete.

Provide environment information

npx next info

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

Performance

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

Other (Deployed)

Additional context

We cannot test on canary in production (ECS/Docker environment). However, PR #88577 was merged into canary on Feb 10, 2026, and issue #90898 confirmed it was fixed in 16.2.0-canary.79.

We are currently experiencing OOM crashes in production on [email protected] (stable). Issues #90433 and #90898 were both closed without backporting the fix to stable.

Please backport PR #88577 to stable so production users can benefit from this fix.

We are not using Next.js fetch cache at all, but clone-response.ts still tee's every response internally, causing ArrayBuffer retention on every request.

extent analysis

TL;DR

The most likely fix for the memory leak issue is to backport PR #88577 to the stable version of Next.js.

Guidance

  • Verify that the memory leak is caused by the clone-response.ts file retaining ArrayBuffer references on every request, as mentioned in the issue.
  • Check if upgrading to a version of Next.js that includes the fix from PR #88577 is feasible, considering the current version is 16.2.2.
  • Consider applying a temporary workaround, such as increasing the Docker container's memory limit or implementing a custom solution to release the retained ArrayBuffer references.
  • Review the changes made in PR #88577 to understand the root cause of the issue and potential implications of backporting the fix.

Example

No code snippet is provided as it is not explicitly supported by the issue.

Notes

The issue is specific to the standalone output mode of Next.js and the clone-response.ts file. The fix has been confirmed to work in the canary version, but it has not been backported to the stable version.

Recommendation

Apply workaround: Increase the Docker container's memory limit or implement a custom solution to release the retained ArrayBuffer references, as backporting PR #88577 to the stable version may take time.

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 PR #88577 fixes memory leak in canary but has not been backported to stable (16.2.2) [2 comments, 2 participants]