help
help copied to clipboard
RangeError: Array buffer allocation failed
Version
12.22.0 32bit
Platform
windows 10 20H2 x64
Subsystem
No response
What steps will reproduce the bug?
const test = async function (b1) { b1 = Buffer.concat([b1, Buffer.from('\n')]) b1 = Buffer.concat([b1, Buffer.from('\n')]) b1 = Buffer.concat([b1, Buffer.from('\n')]) b1 = Buffer.concat([b1, Buffer.from('\n')]) return b1 } const test2 = async () => { let b1 = Buffer.alloc(1024 * 1024 * 300, '1') console.log(b1.length) b1 = await test(b1) console.log(b1.length) } test2()
How often does it reproduce? Is there a required condition?
Most time
What is the expected behavior?
Run successfully and print 314572800 314572804
What do you see instead?
UnhandledPromiseRejectionWarning: RangeError: Array buffer allocation failed
at new ArrayBuffer (
Additional information
I want to concat a buffer and get a full buffer.
But memory usage never goes down. Is there anything wrong with gc?
Have you tried allocating a smaller buffer than 1024 * 1024 * 300?
Looks like you do not have enough memory to handle your buffer size.
@fluentwind - is this resolved?
Hello, I'm using NextJS with webpack and got this issue when I run npm run dev.

Please let me know what is the issue and how to solve this. Thanks in advance!
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.