Closed denyaalt closed 6 days ago
How to avoid the error and why does it occur?
Your Node process is running out of memory, if your system has enough memory you can increase the heap size with command line flags.
If SharedArrayBuffer is not added as a property of the object, then the error does not occur.
That's because then Node can collect the memory (release it).
I create a SharedArrayBuffer of 1 byte in size, a total of 60kB should be allocated. This is an internal node bug; it reserves memory in the amount of maxByteLength for each SharedArrayBuffer instance. Why do we need maxByteLength then, if the memory is already reserved?
Hi @denyaalt!
As @benjamingr stated, the error that is occuring is that your system has run out of memory. IIRC (and IIUC), SharedArrayBuffer
will allocate the maximum amount of memory needed, in case it ends up needing that memory. (Although I might be wrong).
I'm optimistically adding workaround provided
, but if you disagree, let me know and I'll remove it.
Version
v20.12.0
Platform
Linux 6.1.0-17-amd64 Debian 6.1.69-1
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
No response
What do you see instead?
Additional information
Hi, Immediately after startup, the node crashes due to memory failure. If
SharedArrayBuffer
is not added as a property of the object, then the error does not occur. How to avoid the error and why does it occur? Thanks.