I\'m having some trouble to understand how Node.js acts based on the parameter max-old-space-size
.
In my case, for example, I\'m running two t2.sma
These options are now documented officially by node. For a 2GB machine, you should probably use:
NODE_OPTIONS=--max-old-space-size=1536
To determine the amount to use: You can see available memory on a Linux machine using free -m
. Note that you can use the free
and the buffers/cache
memory combined, as buffers/cache
can be thrown away (these buffers and cache are a nice way to use otherwise unused memory).
Note the official documentation formax-old-space-size also mentions:
On a machine with 2GB of memory, consider setting this to 1536 (1.5GB)
Hence the value above. Consider that the amount of memory needed for the base OS doesn't change much, so you could happily do 3.5 on a 4GB machine etc.