Tuesday, 23 May 2017

Nodejs setTimeOut() Listener memory leak

I am trying to use setTimeOut() and registering listeners.

Example : setTimeOut(function(){},5000);

When I am hitting many http requests then I am getting a warning saying : Possible memory leak detected , increasing event listener size.

After seeing this issue , i googled up and went through literature on event emitters and the use of removeListener() method and I think I understood that.

But coming back to my issue , since in a setTimeOut call there are no event/emitters visible , hence I am unable to make out how to do removeListener() after completion of timeout so that I can be saved of any memory leak.

I might be wrong on my understanding , looking forward for guidance.



via professionallyme86

No comments:

Post a Comment