ucss icon indicating copy to clipboard operation
ucss copied to clipboard

possible EventEmitter memory leak

Open radfahrer opened this issue 9 years ago • 5 comments

I'm seeing a lot of: (node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit.. Is this a real concern?

radfahrer avatar Apr 11 '16 17:04 radfahrer

Thanks for reporting! I will have a look at this as soon as possible (although I cannot promise when).

oyvindeh avatar Apr 14 '16 12:04 oyvindeh

I'm unable to reproduce this. uCSS only creates two event emitters itself. But I see that Request has several issues mentioning EventEmitter memory leaks.

I've tried updating to the newest version of Request, hoping that it fixes the problem. Could you please check if the problem persists?

If this still is a problem, it may be because of a redirect loop. Setting maxRedirects in the options when doing request.get (lib/css.js and lib/html.js) may help. I would be grateful if you could try this, or provide me with the config you use so that I can reproduce and investigate further. Thanks!

oyvindeh avatar May 01 '16 10:05 oyvindeh

Did you, by any chance, get the warning when running tests?

oyvindeh avatar May 01 '16 11:05 oyvindeh

@oyvindeh I was getting the error when using ucss on a large complex site, I am still seeing these warnings, possibly in conjunction with timeouts

Timeout: http://localhost:3000/support/faq 
(node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use       emitter.setMaxListeners() to increase limit. 
Trace
    at Request.addListener (events.js:239:17)
    at Request.start (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:807:8)
    at Request.end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:1418:10)
    at end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:580:14)
    at Immediate._onImmediate    (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:594:7)
    at processImmediate [as _immediateCallback] (timers.js:383:17)
(node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use   emitter.setMaxListeners() to increase limit.
Trace
    at Request.addListener (events.js:239:17)
    at Request.start (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:807:8)
    at Request.end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:1418:10)
    at end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:580:14)
    at Immediate._onImmediate  (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:594:7)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

radfahrer avatar May 04 '16 18:05 radfahrer

Yup I can confirm this. I think this might be shown in new version of Node.

meetwudi avatar Apr 05 '17 06:04 meetwudi