base64-arraybuffer
base64-arraybuffer copied to clipboard
Memory leak in encode
We internally used this package for encoding/decoding large pdf files and noticed our instance crashing on around 2gb of files. The instance had free memory of 12gb! After hours of debugging we narrowed it down to the encode function of this library. I read the encode function code and tried to figure out why? But couldn't find a leak. But from our testing and debugging, I am sure there's a memory leak in encode function (in nodejs v8) @niklasvh
I think I'm also facing a memory leak with this library, did you find a solution for it? @murugu-21
Yes, just use the inbuilt Buffer library like below
const fileContent = 'abc';
const fileBase64 = Buffer.from(fileContent).toString('base64'); // same as encode(fileContent)
Buffer.from(fileBase64, 'base64'); // same as decode(fileBase64)
Hope it helps!