I got a fatal error reading a file that was too big to fit in a buffer.
FATAL ERROR: v8::Object::SetIndexedPropertiesToExternalArrayData() length exceeds max acceptable value
Or,
RangeError: "size" argument must not be larger than 2147483647 at Function.Buffer.allocUnsafe (buffer.js:209:3)
If I try to allocate a 1GB Buffer I get the same fatal Error,
var oneGigInBytes = 1073741824;
var my1GBuffer = new Buffer(oneGigInBytes); //Crash
What is the maximum size of a Node.js Buffer class instance?
Maximum length of a typed array in V8 is currently set to kSmiMaxValue
which depending on the platform is either:
Relevant constant in the code is v8::internal::JSTypedArray::kMaxLength
(source).
V8 team is working on increasing this even further on 64-bit platforms, where currently ArrayBuffer
objects can be up to Number.MAX_SAFE_INTEGER
large (2**53 - 1). See bug 4153.