Our server runs Node.JS on a cloud PaaS (specifically Bluemix).
We can configure the amount of allocated memory through the PaaS dashboard, but I noticed that for values above ~1.4GB you also need to execute node with the --max-old-space-size
option (explanation here).
This means that whenever I want to change the size of allocated memory, I have to change it in two places in the settings.
What would happen if I call node --max-old-space-size 99999999999 app.js
? Will Node.JS try to allocate 99999999999MB, or will it consider the actual memory-limit of the VM\Container in which it runs? Does it affect the behavior of the GC (i.e. if it looks like there is a lot of free space, the GC will run less times)? Is there a --max-old-space-size use-machine-limits
option?
Thanks
What would happen if I call node --max-old-space-size 99999999999 app.js? Will Node.JS try to allocate 99999999999MB, or will it consider the actual memory-limit of the VM\Container in which it runs?
Node will not allocate the said memory, but it will attempt to, in response to growing memory demand, if that happens, in the application - incrementally, in reasonably small chunks.
Does it affect the behavior of the GC (i.e. if it looks like there is a lot of free space, the GC will run less times)?
Yes, the tenure space can contain lot of garbage, and the de-allocation will be less frequent.
Is there a --max-old-space-size use-machine-limits option?
Honestly, I don’t know - but will research on this, and update here, if I get information on this.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With