Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Memory leak]The destroyNamespace method doesn't seem to work #67

Open
GO-DIE opened this issue Jun 28, 2021 · 1 comment
Open

[Memory leak]The destroyNamespace method doesn't seem to work #67

GO-DIE opened this issue Jun 28, 2021 · 1 comment

Comments

@GO-DIE
Copy link

GO-DIE commented Jun 28, 2021

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.

@GO-DIE GO-DIE changed the title The destroyNamespace method doesn't seem to work [Memory leak]The destroyNamespace method doesn't seem to work Jun 28, 2021
@PhakornKiong
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants