Skip to content

RangeError: Array buffer allocation failed #1818

Open
@tahv0

Description

@tahv0
RangeError: Array buffer allocation failed
    at new ArrayBuffer (<anonymous>)
    at new Uint8Array (<anonymous>)
    at new FastBuffer (buffer.js:79:1)
    at Function.alloc (buffer.js:283:10)
    at new Buffer (buffer.js:180:19)
    at module.exports.Reader.addChunk (/home/node/app/node_modules/packet-reader/index.js:35:21)
    at Socket.<anonymous> (/home/node/app/node_modules/pg/lib/connection.js:117:18)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

Hi. There is possibly a memory allocation bug. Reader from packet-reader becomes full and it is not cleared after an event is emitted?

I use pg-listen package which uses this library and after like 10k trigger events I got this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions