I am developping a web app using reactjs and nextjs. When i run it in dev mode, my ram is used up 100%. Im having a 12gb ram and almost 6gb is used up by node js runtime. My colleague has a 24gb ram and when he run it, node js uses almost 15gb ram. When a modification is done to the code, the node js runtime uses up 100% and everything else crashes.
The versions are as follows (as per package.json); "next": "^13.2.1", "react": "^18.2.0"
In the terminal, the below error is displayed.
<w> [webpack.cache.PackFileCacheStrategy] Caching failed for pack: RangeError: Array buffer allocation failed
Terminal log:
I have added the following code block to the next.config.js
webpack(config, { webpack }) {
config.infrastructureLogging = { debug: /PackFileCache/ }; // Define infrastructureLogging inside the webpack function
return config;
}
According to those logs, when the web app starts, it creates a cache file and its size is almost 10gb. Everytime a change is made, the cache file is recreated.
Infrastructure Log:

