I'm using node v0.12.4.
When I run the following code with node --max-old-space-size=8192 test.js
it gives me the error FATAL ERROR: invalid array length Allocation failed - process out of memory
var a = new Array(200000000);
console.log(a.length);
However if I change the size to 300000000 I don't get any error. What's going on here? Is there some command line argument aside from --max-old-space-size
I need to change?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…