http2If you use req.write("") in http2, with an empty string, the memory gets higher and higher without end. Memory leak?
req.write("", () => {
console.log("dun knoe");
});

Note: Re-creation script is a few posts down this one
Entirely possible. Will investigate.
ping /cc @addaleax
Evaluating test-http2-zero-length-write.js is not revealing any leaks when using the lower level API. @dolanmiu ... can I ask you to please put together a more complete test case that demonstrates the issue consistently that I can try. Thank you.
the memory gets higher and higher without end. Memory leak?
How are you calling .write()? If you do so in a synchronous loop, this is more or less expected, because the streams implementation needs to keep track of each callback that you passed to write().
Here, I have created a simplified script to re-create the issue:
save it as a test.js file, and type node test.js:
const http2 = require("http2");
const client = http2.connect(`https://www.google.com`);
const req = client.request({
":method": "POST",
":path": `/v2/events`,
authorization: `Bearer test-here`,
"content-type": "multipart/form-data; boundary=dench-gang",
});
req.on("response", (headers, flags) => {
for (const name in headers) {
console.log(`${name}: ${headers[name]}`);
}
});
req.write("");
req.end();
@addaleax no loop from what I can see, unless I am missing something
I think I've found the key. I'll work on it.
Most helpful comment
Here, I have created a simplified script to re-create the issue:
save it as a
test.jsfile, and typenode test.js: