dantheman
dantheman
DDeno
Created by dantheman on 8/14/2023 in #help
How to release node:zlib resources
I have some testcases which use the node:zlib polyfill and I'm having a bit of trouble getting the tests to pass. Here's a very basic example:
import { createDeflate } from 'node:zlib';
Deno.test('deflate teardown', async () => {
const deflate = createDeflate();
deflate.close();
await new Promise(ok => setTimeout(ok, 1000));
});
import { createDeflate } from 'node:zlib';
Deno.test('deflate teardown', async () => {
const deflate = createDeflate();
deflate.close();
await new Promise(ok => setTimeout(ok, 1000));
});
When I run this, Deno finds a leak:
error: Leaking resources:
- A "zlib" resource (rid 3) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
error: Leaking resources:
- A "zlib" resource (rid 3) was created during the test, but not cleaned up during the test. Close the resource before the end of the test.
Am I missing something, or is this an issue with the node:zlib polyfill?
2 replies
DDeno
Created by dantheman on 3/24/2023 in #help
Investigating memory leak after adding new app dependency
10 replies
DDeno
Created by dantheman on 3/8/2023 in #help
How can I create a linked [ReadableStream,WritableStream] pair?
Hi, I have a function A which accepts a WritableStream and another function B which accepts a ReadableStream. How can I plug them into each other so that the writes from function A will be given to function B? In NodeJS this could be accomplished with an NPM package like https://github.com/indutny/stream-pair.
4 replies