Next 9.5.1 out of memory after some hot reloads
See original GitHub issueBug report
Describe the bug
Since updating to 9.5.x (from 9.4.x), i get an out of memory error after 10 something hot reloads:
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
it did rarely happen in 9.4.1, but it happens very consistantly in 9.5.x
To Reproduce
thats probably tricky. it happens on big projects and might be related to some bug in the hot reload / rebuild. Maybe it happens when there are some import circles?
Expected behavior
nextjs should not go out-of-memory
System information
- OS:macOS
- Browser: chrome
- Version of Next.js: 9.5.1
- Version of Node.js: 12.13.1
Additional information
we are using a custom server with typescript
Issue Analytics
- State:
- Created 3 years ago
- Reactions:177
- Comments:144 (18 by maintainers)
Top Results From Across the Web
How to Allocate More Memory to Javascript Heap Using Next.js
I encounter a similar issue recently and it was due to VS code automatically importing a log method from an existing npm module....
Read more >next-transpile-modules - npm
This plugin aims to solve the following challenges: code transpilation from local packages (think: a monorepo with a styleguide package); code ...
Read more >PopVision Graph Analyser User Guide - Graphcore Documents
The PopVision Graph Analyser generates the following reports: ... a model with high memory consumption may go out of memory when profiling is...
Read more >“How-to” Guides - Spring
For instance, the following example loads a YAML configuration file from the ... directly to the classpath (for hot reloading purposes).
Read more >Release Notes for the Cisco ASA Series, 9.6(x)
For a standalone ASA, after the unit reloads with the new version, ... If a value less than 456,384,512 is returned for “Max...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
this is extremly hard to do, but i am 100% sure others have the same issue. Do you hav any idea how this could happen? Its a new problem and happens very consistantly.
maybe circular dependencies? I investigate now in that
Just a small update:
Used
node-oom-heapdump
to grab a heap snapshot of our app when it crashed.It seems to call out one of Webpack’s dependencies,
watchpack
(and itsDirectoryWatcher.js
), which makes sense to me because my crashes happen the most when I’m in dev mode, switching between branches that have a large number of changed files between them.I have sent the heap snapshot to the Next.js team so hopefully it will help them look into this. I think I’m potentially going to open an issue on the Watchpack repo as well.