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

Receiving an event emitter memory leak #121

Closed
micahblu opened this issue Feb 3, 2016 · 4 comments
Closed

Receiving an event emitter memory leak #121

micahblu opened this issue Feb 3, 2016 · 4 comments

Comments

@micahblu
Copy link
Contributor

micahblu commented Feb 3, 2016

I have 0.6.0, when running the gulp task I get:

[11:31:26] Starting 'critical'...
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at process.EventEmitter.addListener (events.js:160:15)
    at process.on.process.addListener (node.js:769:26)
    at module.exports (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/penthouse/lib/index.js:77:13)
    at tryCatcher (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/util.js:26:23)
    at ret (eval at <anonymous> (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/promisify.js:163:12), <anonymous>:12:39)
    at /home/micah/Projects/wirecashwebsite/node_modules/critical/lib/core.js:166:20
    at tryCatcher (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/promise.js:507:31)
    at Promise._settlePromiseAt (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/promise.js:581:18)
    at Async._drainQueue (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/async.js:133:10)
    at Async.drainQueues (/home/micah/Projects/wirecashwebsite/node_modules/critical/node_modules/bluebird/js/main/async.js:15:14)
    at process._tickCallback (node.js:415:13)

My gulp task:

var critical = require('critical').stream;

// Generate & Inline Critical-path CSS
gulp.task('critical', function() {
    return gulp.src('dist/*.html')
    .pipe(critical({base: 'dist/', inline: true, css: ['dist/assets/stylesheets/main.css']}))
    .pipe(gulp.dest('dist'));
});
@micahblu
Copy link
Contributor Author

micahblu commented Feb 3, 2016

I upgraded to the latest version of node v5.4.1 and still the issue however the error trace is a bit different:

(node) warning: possible EventEmitter memory leak detected. 11 SIGTERM listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at process.addListener (events.js:239:17)
    at module.exports (/home/micah/Projects/wirecashwebsite/node_modules/penthouse/lib/index.js:77:13)
    at tryCatcher (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/util.js:26:23)
    at ret (eval at <anonymous> (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/promisify.js:163:12), <anonymous>:13:39)
    at /home/micah/Projects/wirecashwebsite/node_modules/critical/lib/core.js:166:20
    at tryCatcher (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/util.js:26:23)
    at Promise._settlePromiseFromHandler (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/promise.js:507:31)
    at Promise._settlePromiseAt (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/promise.js:581:18)
    at Async._drainQueue (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/async.js:128:12)
    at Async._drainQueues (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/async.js:133:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/micah/Projects/wirecashwebsite/node_modules/bluebird/js/main/async.js:15:14)
    at processImmediate [as _immediateCallback] (timers.js:383:17)

@pocketjoso
Copy link
Contributor

You could always add process.setMaxListeners(0) in your code, which will mute this warning.

Not sure why critical itself is leaking though.

@bezoerb
Copy link
Collaborator

bezoerb commented Feb 4, 2016

@micahblu could you test against the master or vinyl branch? I Think this could be related to the recently fixed memory leaks in penthouse. I just tested gulp + critical on a folder with 36 files and got no memory leak warnings. So i guess this is should already be fixed.

@micahblu
Copy link
Contributor Author

micahblu commented Feb 8, 2016

@bezoerb I'm going to close this for now as it only appears to be happening on my ubuntu machine? I've tried the task on several other machines and was unable to recreate the issue. Thanks for the quick reply.

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