piping
piping copied to clipboard
possible EventEmitter memory leak detected
I am getting following warning when use version "[email protected]": possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
downgrade to @0.3.0, and it solves the problem
I think I have reproduced this, and pushed a fix for a race condition on reloads as 1.0.0-rc.3. If this doesn't fix the issue, can you give me an example?
I see the same error using 1.0.0-rc3 on a CENTOS7 platform. Works fine if I downgrade to 0.3.0. Also works fine on OSX using 1.0.0-rc3.
Also having this issue when a large amount of files change (e.g. switching branches). Has taken up all system memory on two occasions. Downgrading to 0.3.0 appears to have fixed.
With the new changes in node 6.6.0 to help debug, I've definitely fixed at least one leak (released as 1.0.0-rc.4) related to large numbers of files changing simultaneously. Hope it works this time!
I still got the EventEmitter leak with -rc.4. (I think with lower memory usage, but I can't be 100% sure on that.) I was using node 4.4.0. I upgraded to node 6.6.0, and the leak disappeared. I then downgraded to node 4.5.0 with [email protected], still no leak. So it looks like a problem with something that fixed between node 4.4.0 and 4.5.0!
Just encounter this problem today. My issue actually has nothing to do with large number of files changing simultaneously. As soon as I start the app in dev mode, the "memory leak" message will flood in. If I don't kill it quickly, it will quickly eats up all memory + swap and freeze the machine.
Unfortunately following @PitmanPete 's solution doesn't solve the problem. My current environment is Ubuntu 14.04 LTS, node 5.9.0, npm 3.7.3, piping 1.0.0-rc.3. I've tried node 6.6.0, piping 1.0.0-rc.4, node 6.9.4, piping 1.0.0-rc.4. None of them worked.
The only solution to me is to change piping version to ^0.3.0. However, piping 0.3.0 has some performance issues and I'd much prefer to stay with 1.0.0-rc.4.
What's interesting is that this only happens under Ubuntu. There is no problem when running under Windows or OSX.
Just FYI, here is the error message I got (with piping 1.0.0-rc.4):
[1] (node) warning: possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit.
[1] Trace
[1] at Worker.addListener (events.js:252:17)
[1] at EventEmitter.<anonymous> (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:87:12)
[1] at emitOne (events.js:95:20)
[1] at EventEmitter.emit (events.js:182:7)
[1] at online (cluster.js:445:13)
[1] at Worker.onmessage (cluster.js:431:7)
[1] at ChildProcess.<anonymous> (cluster.js:737:8)
[1] at emitTwo (events.js:105:20)
[1] at ChildProcess.emit (events.js:185:7)
[1] at handleMessage (internal/child_process.js:718:10)
[1] (node) warning: possible EventEmitter memory leak detected. 11 exit listeners added. Use emitter.setMaxListeners() to increase limit.
[1] Trace
[1] at EventEmitter.addListener (events.js:252:17)
[1] at monitor (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:65:11)
[1] at process.<anonymous> (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:171:11)
[1] at emitOne (events.js:90:13)
[1] at process.emit (events.js:182:7)
[1] at process._fatalException (node.js:264:26)
[1] (node) warning: possible EventEmitter memory leak detected. 11 online listeners added. Use emitter.setMaxListeners() to increase limit.
[1] Trace
[1] at EventEmitter.addListener (events.js:252:17)
[1] at monitor (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:74:11)
[1] at process.<anonymous> (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:171:11)
[1] at emitOne (events.js:90:13)
[1] at process.emit (events.js:182:7)
[1] at process._fatalException (node.js:264:26)
[1] (node) warning: possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit.
[1] Trace
[1] at Worker.addListener (events.js:252:17)
[1] at EventEmitter.<anonymous> (/home/ubuntu/repos/adxfront_temp/node_modules/piping/lib/piping.js:87:12)
[1] at emitOne (events.js:95:20)
[1] at EventEmitter.emit (events.js:182:7)
[1] at online (cluster.js:445:13)
[1] at Worker.onmessage (cluster.js:431:7)
[1] at ChildProcess.<anonymous> (cluster.js:737:8)
[1] at emitTwo (events.js:105:20)
[1] at ChildProcess.emit (events.js:185:7)
[1] at handleMessage (internal/child_process.js:718:10)
... ...
@realbugger I am experiencing this same problem nearly verbatim. I recently updated to Ubuntu 16.10 which may have introduced this problem having recently had no problems until this update.
I do not know which module is being loaded that uses piping since the stack trace is not specific enough and only indicates the piping module as the culprit.
Same issue here. I'm using Ubuntu at home and Windows 10 at work. I experience this very issue on both operating systems.
It happens to me too. I changed the piping
to 0.3.2
and the error didn't come out anymore. I am on Ubuntu. Anybody has found the workaround?
Edit: I'm running [email protected]
and [email protected]
Any thoughts on this? thanks!
So do I.
This problem also occur in Ubuntu 17.04, nodejs 7.10, piping@^1.0.0-rc.4
We have the same problem and downgrading to 0.3.2 resolved it. (1.0.0-rc.4 on Ubuntu 16.04, node 8.9.1)
Are there any plans to try and fix this? I saw that the last update was already 2 years ago...
Realistically I don't have time any more to work on this project, hence its current somewhat sorry state. I'd gladly accept any PR which fixes this issue for people who still find this useful and release as 1.0.0.
We are currently doing tests with pm2 and its watch option. For now it is working fine. At the moment I have no time to look into this, but if there will some spare time in the future I will be more than happy to have a look at this problem. We really like your plugin, thanks for it!
that helped me - https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers