Following up on this thread:
Lots of null values in an array mean any harm?
I did this with node.js:
arr=[]
arr[1000]=1
arr[1000000000]=2
arr.sort()
And I got
FATAL ERROR: JS Allocation failed - process out of memory
So that leaves me with the question (I couldn't find it on Yahoogle) how much memory is actually allocated for a null entry in an array in node. I do not plan to use 1000000000 entries, not even close, but maybe it's still not worth allocating the memory...
Who knows how I can check?
So in summary, node.js does not allocate memory for undefined values in an array. The crash I experienced must have been a glitch as no one else could reproduce it and installing the latest node.js version eliminated the problem for me as well.
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