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

what is the FIX for warning: "warning: possible EventEmitter memory leak detected. 51 open listeners added. Use emitter.setMaxListeners() to increase limit." #183

Open
eriknyk opened this issue Jan 9, 2016 · 4 comments

Comments

@eriknyk
Copy link

eriknyk commented Jan 9, 2016

Hi, I would to know howto fix the warning: warning: possible EventEmitter memory leak detected. 51 open listeners added. Use emitter.setMaxListeners() to increase limit.

I seen that there are similar closed issues of it, but without real solutions.

if you see here (http://www.jongleberry.com/understanding-possible-eventemitter-leaks.html),
seems removeListeners is being missing
#117

Best Regards.

@vkarpov15
Copy link
Contributor

@eriknyk please provide code example that reproduces this issue

@eriknyk
Copy link
Author

eriknyk commented Jan 13, 2016

I will provide you the code soon thanks.

@ar2rsawseen
Copy link

Running into this too, I am not sure, but I think it happens when there are too many queries executed, when mongoskin returned promise, but have not connected to database yet.

I usually do something like this:

var db = mongo.db(dbName, dbOptions);
db._emitter.setMaxListeners(0);

@dayuoba
Copy link

dayuoba commented Mar 14, 2017

@ar2rsawseen

but have not connected to database yet

this is why,because if mongoskin has not connected to the database, it will register once('open') for the query to do queries when db connected

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

4 participants