question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Events: possible memory leak warning

See original GitHub issue

Hello,

I am using tens of Recharts on a page and I get the following warning: (node) warning: possible EventEmitter memory leak detected. 21 listeners added. Use emitter.setMaxListeners() to increase limit.

I noticed that the eventCenter maxListeners are raised to 20 from the default 10. While many libraries set the value to 0 (unlimited; no warning), the best approach I’ve seen so far is dynamically setting the limits.

Any other idea?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
xile611commented, Sep 21, 2016

😀 OK! I’ll fix this. And only add listener when the chart has props syncId which means to be synchronized with some other charts.

0reactions
jozsicommented, Sep 21, 2016

@xile611 - right, that’s my use case. Many, unsynced charts on one page.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix possible EventEmitter memory leak detected - cri.dev
The warning possible EventEmitter memory leak detected happens when you have more than 10 listeners (read EventEmitter) attached to an event ...
Read more >
possible EventEmitter memory leak detected - node.js
I'd like to point out here that that warning is there for a reason and there's a good chance the right fix is...
Read more >
Possible memory leak? · Issue #518 · node-apn/node ... - GitHub
I am trying for several days to figure out the following error: Warning: Possible EventEmitter memory leak detected.
Read more >
How To Detect and Prevent Memory Leaks | Scout APM Blog
A memory leak is the gradual loss of available computer memory when a program (an application or part of the operating system) repeatedly...
Read more >
Causes of Memory Leaks in JavaScript and How to Avoid Them
A memory leak occurs when an object in memory that is supposed to be cleaned in a garbage collection cycle stays reachable from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found