As I understand it is possible to set a maximum memory usage limit for an application like this:
node --max_old_space_size=500 app.js
Is it possible to get a value of the max_old_space_size
from the code?
UPDATE
With the help of @Grégory NEUT we found out that v8.getHeapStatistics()
contains a field heap_size_limit
which looks like what I am looking for.
However I'm still not sure about it since I didn't find any official documentation (or some piece of code from Node.js) which will approve this theory.
I also don't understand why heap_size_limit
becomes 557842432
bytes (557.8
MB) when I set max_old_space_size
to 500
MB