Link to the code that reproduces this issue
https://github.com/austin-raey/next-memory-issue
To Reproduce
- Run
pnpm install
- In
src/app/page.tsx, replace "http://put-large-api-json-request-here.test" with some JSON endpoint. I didn't want to put someone's URL here as to not DDOS them haha. Preferably one where you are not rate limited. You can probably separately set up a seperate folder with an express (or similar) API endpoint that returns a large JSON payload as to not DOS anyone. As to not pollute the test, it may be best for you to not make this JSON endpoint in this example Next repo itself (this may not make a difference though tbf)
- With Docker Desktop, Rancher Desktop, or etc running, do
make run.
- Open an Inspector session in Chrome / Edge / etc. (
about:inspect in Chromium browsers)
4a. Optionally, go to the http://localhost:3000 page in your browser once, reload the page a few (2 or 3) times, then click "Collect garbage" a few times to ensure a clean heap, then "Take snapshot" of the heap to collect a baseline.
Image of the "Collect Garbage" button in Chromium browsers

- In a seperate terminal tab in the example repository, run
pnpm exec autocannon -R 30 -f http://localhost:3000. Let this run for a few minutes or so. -R 30 may be adjusted for more requests, but 30 is probably fine.
- After waiting, hit CTRL + C to stop autocannon.
- Go to the Inspector. Before taking the heap snapshot, click the "Collect garbage" broom icon to ensure the heap is clean. Note the heap is now larger than baseline and collecting garbage will not reduce this size.
- Inspecting the heap, it seems a large portion is now taken up by fetch. There is also
Array and InternalReadableByteStream which seems suspicious, but I am not sure if they are relevant:
Image of the suspicious items in heap


Current vs. Expected behavior
I would expect the heap, once garbaged collected, to be similar in size to the baseline heap. Instead, the heap size is now permanently larger and it seems a large portion is taken up by fetch.
This larger size is sticky and I haven't seen it ever go back down even after waiting several minutes with no requests made to http://localhost:3000. Manual garbage collection makes no change either.
Provide environment information
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041
Available memory (MB): 49152
Available CPU cores: 14
Binaries:
Node: 25.1.0
npm: 11.6.2
Yarn: N/A
pnpm: 10.20.0
Relevant Packages:
next: 16.0.1 // Latest available version is detected (16.0.1).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: 5.9.3
Next.js Config:
output: standalone
Which area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
- I have seen other tickets make note of this and were able to fix it with a specific version of node, although unfortunately this made no difference for me. I have tried using other of the latest LTS versions of node (20, 22, 24 at the time of writing 24.11.0, 22.21.1, 20.19.5) and it seems this issue still persists on each of these versions. You can easily try different node versions by modifying the first line of the Dockerfile.
- I've also observed this issue on the latest version of Next 15 (15.5.6 at the time of writing).
- Using axios instead of
fetch (which I believe doesn't use undici) seems to help with this issue. Of course, this is not ideal, because Next provides nice additions to fetch for caching.
Link to the code that reproduces this issue
https://github.com/austin-raey/next-memory-issue
To Reproduce
pnpm installsrc/app/page.tsx, replace"http://put-large-api-json-request-here.test"with some JSON endpoint. I didn't want to put someone's URL here as to not DDOS them haha. Preferably one where you are not rate limited. You can probably separately set up a seperate folder with anexpress(or similar) API endpoint that returns a large JSON payload as to not DOS anyone. As to not pollute the test, it may be best for you to not make this JSON endpoint in this example Next repo itself (this may not make a difference though tbf)make run.about:inspectin Chromium browsers)4a. Optionally, go to the
http://localhost:3000page in your browser once, reload the page a few (2 or 3) times, then click "Collect garbage" a few times to ensure a clean heap, then "Take snapshot" of the heap to collect a baseline.Image of the "Collect Garbage" button in Chromium browsers
pnpm exec autocannon -R 30 -f http://localhost:3000. Let this run for a few minutes or so.-R 30may be adjusted for more requests, but 30 is probably fine.ArrayandInternalReadableByteStreamwhich seems suspicious, but I am not sure if they are relevant:Image of the suspicious items in heap
Current vs. Expected behavior
I would expect the heap, once garbaged collected, to be similar in size to the baseline heap. Instead, the heap size is now permanently larger and it seems a large portion is taken up by
fetch.This larger size is sticky and I haven't seen it ever go back down even after waiting several minutes with no requests made to
http://localhost:3000. Manual garbage collection makes no change either.Provide environment information
Platform: darwin Arch: arm64 Version: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:05 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6041 Available memory (MB): 49152 Available CPU cores: 14 Binaries: Node: 25.1.0 npm: 11.6.2 Yarn: N/A pnpm: 10.20.0 Relevant Packages: next: 16.0.1 // Latest available version is detected (16.0.1). eslint-config-next: N/A react: 19.2.0 react-dom: 19.2.0 typescript: 5.9.3 Next.js Config: output: standaloneWhich area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
fetch(which I believe doesn't use undici) seems to help with this issue. Of course, this is not ideal, because Next provides nice additions tofetchfor caching.