How can I increase the max memory for Node?

Node has a default max memory usage of less than 2GB on some 64bit systems. This can cause unexpected memory issues when running on CircleCI. It's possible to adjust the max memory ceiling using a command line flag passed into node:

--max-old-space-size=<memory in MB>


The flag can be difficult to ensure is being used. Especially when node processes are forked. The best way to ensure this setting will be picked up by all node processes within the environment is to apply this setting directly to an environment variable, which can be done using Node. 8 or higher



Further Reading:

Was this article helpful?
46 out of 119 found this helpful



Article is closed for comments.