[Memory leak]The destroyNamespace method doesn't seem to work
GO-DIE opened this issue · comments
GO-DIE commented
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.
Phakorn Kiong commented
This is most likely the case where gc
doesn't get to come and remove everything that is scheduled via async-hook
.
Try adding some timeout
at the back of your code and look at the memory used.