Increased memory consumption in production mode after migration from Next.js 14 to 15 #77318
Labels
linear: next
Confirmed issue that is tracked by the Next.js team.
Performance
Anything with regards to Next.js performance.
Link to the code that reproduces this issue
https://github.com/foxable/reproduction-next15-memory-consumption
To Reproduce
pnpm build
pnpm start
next-server
processTo generate more or less pages, edit
generate-pages.mjs
and runpnpm generate-pages
.Current vs. Expected behavior
Compared to Next.js 14 (try Next.js 14 reproduction for comparison), the production mode in Next.js 15 shows a significantly increased memory consumption, which also significantly increases with the number of pages:
Memory consumption in production mode
While in absolute numbers, the memory consumption is still arguably low, the relative increase is significant, as well as the additional memory consumption for each page.
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Thu, 13 Mar 2025 18:12:00 +0000 Available memory (MB): 31793 Available CPU cores: 16 Binaries: Node: 22.13.0 npm: 10.9.2 Yarn: 1.22.22 pnpm: 10.6.3 Relevant Packages: next: 15.2.3 // Latest available version is detected (15.2.3). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
next start (local)
Additional context
I noticed the increased memory consumption after migrating a project with ~120 pages from Next.js 14.2.24 to Next.js 15. I was also able to reproduce the increased memory consumption with all minor version currently available for Next.js 15.
The text was updated successfully, but these errors were encountered: