Open GO-DIE opened 3 years ago
I used the following code to test and found a memory leak.
const cls = require('cls-hooked') while(1){ const ns = cls.createNamespace('test') ns.run(() => {}); cls.destroyNamespace('test'); }
The destroyNamespace method doesn't seem to work.
This is most likely the case where gc doesn't get to come and remove everything that is scheduled via async-hook.
gc
async-hook
Try adding some timeout at the back of your code and look at the memory used.
timeout
I used the following code to test and found a memory leak.
const cls = require('cls-hooked') while(1){ const ns = cls.createNamespace('test') ns.run(() => {}); cls.destroyNamespace('test'); }
The destroyNamespace method doesn't seem to work.