JavaScript heap out of memory - how to increase the max memory for Node with max_old_space_size
If you want to increase the max memory for Node you can use --max_old_space_size
option. You should set this with NODE_OPTIONS
environment variable.
# Use 4096 MB as max memory for Node
export NODE_OPTIONS=--max_old_space_size=4096
# Run parallel Jest tests with @knapsack-pro/jest
$(npm bin)/knapsack-pro-jest
# Run parallel Cypress tests with @knapsack-pro/cypress
$(npm bin)/knapsack-pro-cypress
What is --max_old_space_size
? It's option for Node 8.
$ node --v8-options
--max_old_space_size (max size of the old space (in Mbytes))
type: int default: 0