Version
20.11.0
Platform
Microsoft Windows NT 10.0.22631.0 x64
Subsystem
undici
What steps will reproduce the bug?
There was an issue #48478 with repoduction https://github.com/Robert-Schirmer/nodejs-mem-leak, and it is not reproducible.
However AbortController still leaks in terms of FinalizationRegistry:
const r = new FinalizationRegistry((tag) => console.log(tag));
function alloc() {
let counter = 0;
(function allocateMemory() {
Array.from({ length: 50000 }, () => () => {});
if (counter > 5000) return;
counter++;
setTimeout(allocateMemory);
})();
}
function test1() {
let x = ['foo', 'bar']
r.register(x, 'test1')
x.length
}
async function test2() {
const ac = new AbortController()
r.register(ac, 'test2')
await fetch('https://nodejs.org', {
signal: ac.signal,
})
}
test1() // test1
test2() // no output
alloc()
How often does it reproduce? Is there a required condition?
Always (with node 20.11.0 native fetch).
What is the expected behavior? Why is that the expected behavior?
Expected output:
What do you see instead?
Actual output:
Additional information
No response
Version
20.11.0
Platform
Microsoft Windows NT 10.0.22631.0 x64
Subsystem
undici
What steps will reproduce the bug?
There was an issue #48478 with repoduction https://github.com/Robert-Schirmer/nodejs-mem-leak, and it is not reproducible.
However
AbortControllerstill leaks in terms ofFinalizationRegistry:How often does it reproduce? Is there a required condition?
Always (with node 20.11.0 native
fetch).What is the expected behavior? Why is that the expected behavior?
Expected output:
What do you see instead?
Actual output:
Additional information
No response