kyr0 / brotli-compress

WASM based, asynchronous Brotli compression and decompression package that works in browsers and Node.js; CommonJS and ESM
Apache License 2.0
18 stars 1 forks source link

Memory leak with repeated compression #2

Open lawruble13 opened 1 year ago

lawruble13 commented 1 year ago

First noticed in browser when using browserify, however this issue can be reproduced in plain Node. There seems to be some buffer whose size increases every time a compression is run. In node you can reproduce this with

const brotli = require("brotli-compress");
var test_data = {foo: "bar"};
for (var i = 0; i < 1000; i++) brotli.compress(test_data);

After running this approximately 1.6 GB of memory is used.

kyr0 commented 8 months ago

Hi, I'm sorry for the late reply. I must have missed this. Thank you for opening this issue. I'll check what I can do :)