Closed franza closed 5 years ago
Hello. I encountered this leak in v1.1.4 and v.1.1.9. As I understand it is because of the old version of eventemitter2 module.
eventemitter2
https://github.com/englercj/node-esl/blob/cff8d9b42efbe7a38df717a9c8e193f183d0dbd2/lib/esl/Connection.js#L272
self.once('esl::event::BACKGROUND_JOB::' + jobid, function(evt) { removeFromFilter(function() { cb(evt); }); });
self.once here creates next object in self.listenerTree:
self.once
self.listenerTree
{ esl: { event: { BACKGROUND_JOB: { [jobid]: { /* listener object */ } } } } }
And when callback is executed it's still:
{ esl: { event: { BACKGROUND_JOB: { [jobid]: { /* empty object */ } } } } }
This produces a memory leak. It can be also reproduced here: https://gist.github.com/franza/02702238bf08dda42321e3f96ecb6251. I tried it with EventEmitter v1 and it fixed it.
It's worth to think about upgrading eventemitter2.
Can we consider this fixed?
Sorry didn’t say it earlier. Yes that was fixed.
Hello. I encountered this leak in v1.1.4 and v.1.1.9. As I understand it is because of the old version of
eventemitter2
module.https://github.com/englercj/node-esl/blob/cff8d9b42efbe7a38df717a9c8e193f183d0dbd2/lib/esl/Connection.js#L272
self.once
here creates next object inself.listenerTree
:And when callback is executed it's still:
This produces a memory leak. It can be also reproduced here: https://gist.github.com/franza/02702238bf08dda42321e3f96ecb6251. I tried it with EventEmitter v1 and it fixed it.
It's worth to think about upgrading
eventemitter2
.