Closed slauko closed 2 years ago
Do you mean readBuffer
? Are you trying to read an array of DWORDS?
I also had the issue but i am not sure how to resolve this.
Here is my work but i m stuck with the Napi::Buffer
Do you mean
readBuffer
? Are you trying to read an array of DWORDS?
ehh yes sorry readBuffer .. i tried reading a dword array in like 20000bytes and then convert the byte array to dwords with the buffer method readUInt32LE(offset) since this would just be 1 read instead 5k reads
but yes the readBuffer method was leaking had like 1gb ram usage after 1 sec :D
Fixed in b6b328a.
@bumpmann see my code comment for details about the problem with Napi::Buffer::New
. Your solution was right, use Buffer::Copy
and manually free the memory.
@Rob-- I solved the problem with your new code, but it's still the old code on NPM. Can you update the version of npm?
like the title says , id like to read chunks of memory but readBytes just leaking memory so i need to read 1000x for an array of DWORDs instead just once a bigger chunk and get the DWORDS from the bytes :/ pretty much unperformant that way