Closed
Description
Hi, I just noticed that when you create debug instance in a function, it is starting to leak the memory without freeing. Here's how you can reproduce it:
const debug = require('debug');
const loop = () => {
const d = debug('namespace:that:i:want:for:this:function');
d('hello world');
setImmediate(loop);
};
loop();
If you run this and look at memory, it is leaking a lot without freeing them.
also does not matter if I set environment to DEBUG=* or not, it still leaks. Any thoughts?
EDIT: tested on 3.1.1 and 4.1.1 as well (had 3.1.1 version and then I upgraded to latest one to check if it was fixed).
EDIT2: using node version 10.13 and Windows 10 x64.