I am trying to increase memory limit in node, so I added an environment variable
it does not work not sure why I also tried it with capital letters here is how I test it
const maxHeapSz = require('v8').getHeapStatistics().heap_size_limit;
const maxHeapSz_GB = (maxHeapSz / 1024 ** 3).toFixed(1);
console.log(`${maxHeapSz_GB}GB`);
I keep gettin 2GB, I'm trying to get 8GB
I appreciate any help
You can use
node --max-old-space-size=8192 app.js
It's work for me!
Result:
node --max-old-space-size=8192 test.js
8.0GB