joyent/node — pull request #6926 by litmit (2014-01-29 08:26:50+00:00)
Title: Out of memory when inspect large sparse array

util.inspect crashes Node when I inspect large sparse array (even empty!)

Try in Node's REPL:
```
> new Array(0xffffffff)
```
Output:
```
FATAL ERROR: JS Allocation failed - process out of memory
```
But this work:
```
var a = new Array(0xFFFFFFFF)
a[0xFFFFFFFF]=1
console.log(a[0xFFFFFFFF],a.length);
```

It is possible to detect large arrays in util.inspect and not output them at whole or replace them with some stub like this:
```
[ 1, 20, 6,
... 2000000 elements skipped ...
34, 68, 30]
```
?