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

More than 10 containers triggers EventEmitter memory leak warning #213

Closed
BryanDonovan opened this issue Jan 3, 2013 · 4 comments
Closed
Labels

Comments

@BryanDonovan
Copy link

If you create more than 10 containers, node's EventEmitter spews a warning about a possible memory leak.

I forked the project and added a test that demonstrates the problem (the test doesn't fail, but you should see the warning): https://github.com/BryanDonovan/winston/tree/max-listeners

My hacky solution is to add maxListeners as an option to container.get():

container.get('foo', {
  maxListeners: 0,
  file: {
    filename: '/foo/bar.log'
  }
});

@mainiak
Copy link

mainiak commented May 31, 2013

So solution is just to rise maximum of the listeners?

@BryanDonovan
Copy link
Author

Yeah, at least for my scenario. The "real" solution was to rewrite my code to not have 10 containers in one logger instance.

@indexzero
Copy link
Member

Related to #327

indexzero added a commit that referenced this issue Jun 9, 2015
Suggested fix for #213: More than 10 containers triggers EventEmitter…
@indexzero
Copy link
Member

Fixed in 44564de

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

No branches or pull requests

3 participants