High Memory Usage by next-server process. #70178
Replies: 4 comments 3 replies
-
Hey @ShivamArora We are experiencing the same problem. Did you find any workaround for it. ? |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue. It's as if Next has a memory leak. |
Beta Was this translation helpful? Give feedback.
-
Hi there, it's been a long time that I have the same issue. We have a pretty big Next project, but it is impossible to work with in dev mode. It goes up to more than 13gb of memory usage at each fast refresh. Even tho my mac (M1 Pro) has 16gb unified memory, so it goes up to about 20gb in swap. For real this is getting crazy. I am used to have slowness issues as I often work with React Native on iOS and Android simulators, running XCode and Android Studio at the same time, but wow, it is so fast compared to just using Next in dev mode... Next seems to not be scalable at all, or have a memory leak somewhere, maybe it is on our side tho.. It would be really helpful if someone has a workaround, or even a bit of an idea of what could be happening. Thanks in advance, |
Beta Was this translation helpful? Give feedback.
-
Same issue here. Most promising issue tracking this seems to be: #78069 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
We're experiencing significantly high memory usage by the
next-server
process when using Turbopack locally.Initially when the server is started using
next dev --turbo
, the process is well under 250MB. But as soon as we open a page and the compilation starts for the page, the memory usage jumps to ~6.5GB and then doesn't come down even after the page has been compiled and displayed and the system is in an idle state.On making changes to the codebase with HMR, we've seen the memory usage jumping to even 10-11GB at times which makes it difficult to work with the project as the system becomes slow.
Comparatively when we don't use turbopack and start the project with Webpack, it takes around 3.5GB-4GB when a page is loaded and turbopack is using comparatively more than 1.5x memory than Webpack.
We haven't been able to identify what is the root cause behind such high memory consumption. And it is making tremendously difficult to use turbopack with our project.
Additional information
Beta Was this translation helpful? Give feedback.
All reactions