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
kSmiMaxValuewhich 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
ArrayBufferobjects can be up toNumber.MAX_SAFE_INTEGERlarge (2**53 – 1). See bug 4153.