0

I work in a Nexjs project. It use @mui/material.

Follow an issue appDir + RSC: "The server is running out of memory, restarting to free up memory" on github of Nextjs.

When I run dev after time, my RAM out.

I only have 8GB RAM on my laptop. When RAM is out, my laptop stuck. I can not do any thing, even move the mouse.

I often press and hold the power button to force power off the laptop.

When I work in an laptop with 16GB ram. The message The server is running out of memory, restarting to free up memory show when RAM usage reach about 12GB.

It seem nodejs or Nextjs limit RAM usage. But It is too high with me (8GB RAM).

I want to limit RAM usage of Nextjs when dev. When Nextjs use more RAM which I limited. The progress auto stop or show a message.

When the nextjs use out of RAM. There are small free ram which I can do something like stop nextjs.

How can I do that?

kan
  • 73
  • 6
  • https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes See this V8 options. Or there is memory leak with Next.JS. Or use it like this with env https://stackoverflow.com/a/63495296/14813577. – kennarddh Aug 28 '23 at 03:41

0 Answers0