Skip to content Skip to sidebar Skip to footer

How Can I Create An Array With 200 Million Elements On NodeJs?

To do some benchmarking, I tried to create a huge array. The code was simple: var hugeArray = []; for (var i = 0; i < 2*1000*1000*100; i ++) { hugeArray.push(Math.ceil(Math.

Solution 1:

V8's heap size is limited to 1 GB..So if you want to increase it run following

node --max-old-space-size=8000 yourScript.js

Hope this helps.


Post a Comment for "How Can I Create An Array With 200 Million Elements On NodeJs?"