I'm aware the maximum length of a JavaScript array is 2^32-1, but regardless of how much memory I permit it will still fail to allocate. What's going on? One-line repro:
node --max-old-space-size=100000 -e "console.log(v8.getHeapStatistics().total_available_size);Array.from({ length: Math.pow(2, 32)-1 })"
For clarity the above example exposes 100GB to v8, which is confirmed via total_available_size. 8GB might be sufficient for testing this operation since most people won't have 100GB, but it'll fail regardless. Is this a bug in V8?