question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: extremely high memory usage with `next dev`

See original GitHub issue

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: android
  Arch: arm64
  Version: #2 SMP PREEMPT Fri Aug 5 15:52:33 AST 2022
Binaries:
  Node: 18.10.0
  npm: 8.19.2
  Yarn: 1.22.19
  pnpm: N/A
Relevant packages:
  next: 13.0.3-canary.0
  eslint-config-next: 13.0.2
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

Chrome Canary v109.0.5400.0 (Android)

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

The memory usage on the last next 13 (13.0.3-canary.0 and 13.0.2) releases are too high. next dev command uses about 1gb of ram. Next 12 is using about 300mb-500mb’s of ram.

Screenshot_20221104-225938_Termux

Expected Behavior

next dev should use less ram.

Link to reproduction

.

To Reproduce

  1. Create project with Next 13
  2. Run next dev
  3. Check the ram usage

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:34
  • Comments:59 (14 by maintainers)

github_iconTop GitHub Comments

15reactions
feedthejimcommented, Dec 9, 2022

Another update:

  • good news: I merged two fixes, so hopefully the next canary will help.
  • bad news: there’s another memory leak that comes from Node itself which means that it’s gonna be very hard to fix. I’m currently exploring how we could work around the issue.
  • bad news 2: i think I saw another memory leak linked to the edge runtime, so I’ll have to investigate that too.
14reactions
feedthejimcommented, Dec 8, 2022

hey, sorry I was busy investigating the issue!

Small update: I managed to identify the 3 main sources of memory leaks that I think are causing the crashes in dev so I’ll work on fixing those quickly. This should help a lot hopefully.

Thanks @soylemezali42 for the test app, it was very very helpful 🙏.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next dev server RAM usage issue : r/nextjs - Reddit
My Nextjs dev server slowly starts at an average RAM usage but eventually inflates to 1GB+ RAM usage. Is this just me or...
Read more >
Debugging and fixing a memory leak on NextJS / Node
Last week I had to debug my first memory leak: our server crashed at regular intervals and the memory usage chart showed that...
Read more >
Troubleshooting Node.js Memory Use - Heroku Dev Center
Very large memory use might even crash the Node process, leading to dropped requests and downtime. If a memory leak is small and...
Read more >
Very high memory usage of GPU Process after watching many ...
So far, I do not see anything like "extremely high" memory usage ... reports in about:memory for Mozilla Firefox developers for deep analyzing...
Read more >
Reduce memory usage in files – Figma Help Center
If you're working with large files or libraries in Figma you may run into these limits. To continue to use affected files, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found