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

Possible EventEmitter memory leak detected. #63

Closed
southwhale opened this issue Feb 23, 2021 · 2 comments
Closed

Possible EventEmitter memory leak detected. #63

southwhale opened this issue Feb 23, 2021 · 2 comments

Comments

@southwhale
Copy link

southwhale commented Feb 23, 2021

My project installed promise-socket@6.0.3, when I call 'socket.writeAll' in setInterval, some warnings printed on console.

(node:46580) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
(node:46580) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListeners() to increase limit
(node:46580) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 finish listeners added. Use emitter.setMaxListeners() to increase limit
(node:46580) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 drain listeners added. Use emitter.setMaxListeners() to increase limit

And I can't listen timeout event with on or once of promise-socket's instance, so I use promiseSocketInstance.socket.once instead.
Thanks.

@clouedoc
Copy link

clouedoc commented Dec 5, 2021

I have the same issue. I'm going to use emitter.setMaxListeners() to 20 and see if it improves things.

      // init socket
      await this._socket.connect(4070, apAddress);
      this._socket.socket.setMaxListeners(20);

dex4er added a commit that referenced this issue Jun 21, 2024
dex4er added a commit that referenced this issue Jun 21, 2024
@dex4er
Copy link
Owner

dex4er commented Jun 21, 2024

@dex4er dex4er closed this as completed Jun 21, 2024
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

3 participants