jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 191 forks source link

PackageTask possible EventEmitter memory leak #117

Closed mvolkmann closed 12 years ago

mvolkmann commented 12 years ago

Sorry to post an issue when this is likely something I'm doing wrong, but I couldn't find an email address to contact you directory. I'm trying to learn how to use PackageTask. I'm getting the following:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.

Here's what I'm doing:

var t = new jake.PackageTask('demo', 'v0.1', function () { var fileList = ['images/*']; this.packageFiles.include(fileList); this.needTarGz = true; });

And then I run "jake package".

prabirshrestha commented 12 years ago

i'm getting the same error.

I don't think it is the problem with PackageTask coz I don't use it at all.

I get it when I use lots of tasks. Most likely some code aren't removing the listeners.

mde commented 12 years ago

Inside Jake it's using the "once" method to ensure that internal listeners get removed. Is there maybe just a lower limit set on Windows or something?

prabirshrestha commented 12 years ago

I think it might not be a problem with jake, but rather our own code.

When I was using https://github.com/mpareja/paprika I got that error when I had more then 10 tasks or was using nested namespaces can't remember it.

When I moved to my own library https://github.com/prabirshrestha/njake event emitter leak stopped occurring.

mde commented 12 years ago

I'll close until/unless I get a minimal repro case, thanks.