-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Description
Link to the code that reproduces this issue
https://github.com/grzegorz-orbital/nextjs-bug
To Reproduce
-
Clone repository (I prepared a small test repository that reproduces this issue):
https://github.com/grzegorz-orbital/nextjs-bug -
To trigger the problem, run
./run_next.sh
in a terminal — this starts Next in production mode. -
Install Rust — it’s required to run the performance test:
https://rust-lang.org/tools/install/ -
In a second terminal run
./run_goose_attack_api.sh
. You only need Rust installed locally because the load tests are written in Rust.
When I run this test on my MacBook the test finishes in about one minute. It executes 40,000 requests.
After the test finishes, the Next process memory stays around ~15 GB and does not drop.
I tested it on the canary version as well (the canary branch). The behavior is the same.
Current vs. Expected behavior
I would expect that after the load test completes, the process memory usage would return to approximately the same level as before the test started.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
Available memory (MB): 24576
Available CPU cores: 14
Binaries:
Node: 24.4.0
npm: 11.4.2
Yarn: 1.22.22
pnpm: 10.14.0
Relevant Packages:
next: 15.5.4 // Latest available version is detected (15.5.4).
eslint-config-next: N/A
react: 19.2.0
react-dom: 19.2.0
typescript: N/A
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Dynamic Routes
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
No response