8000 High memory usage in development (10GB+) · Issue #78069 · vercel/next.js · GitHub
[go: up one dir, main page]

Skip to content
High memory usage in development (10GB+) #78069
@diogomartino

Description

@diogomartino

Link to the code that reproduces this issue

https://github.com/diogomartino/next-app-router-playground

To Reproduce

  1. Start the app in dev mode
  2. Open every single route you have available
  3. Memory usage keeps rising like crazy. The more routes you have, the more the RAM rises.

Current vs. Expected behavior

I expected that NextJS didn't use 10GB.

Provide environment information

Ubuntu 22.04.5 LTS x86_64
Kernel: 6.8.0-57-generic

pnpm 7.33.5

Node v20.13.1
next: 15.2.3

Using turbo.

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

Performance

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

next dev (local)

Additional context

So I made a script that fetches every single route for my project and plotted the RAM usage so you can see it increasing. As soon as all routes are fetched at least once, the memory usage stabilizes.

Image

For my project, the next-server starts at like 300 MB and rises all the way up to 9-10 GB. I also tried a template from vercel (https://vercel.com/templates/next.js/app-directory) and the same happens, but it's not so noticeable because the code is much simpler and it has fewer routes. In the template case, it wen't up to like 4GB, which is already too much.

I also tried with the most recent version (15.3.0) and it's the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PerformanceAnything with regards to Next.js performance.linear: nextConfirmed issue that is tracked by the Next.js team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0