2

I tried to increase the no.of listeners using Event Emitter. But it's not working. The same is running with no warnings in windows.

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

Trace

    at EventEmitter.addListener (events.js:160:15)
    at Server.connect (/dir/node_modules/mongoose/node_modules/mongodb/lib/server.js:291:17)
    at Db.open (/dir/node_modules/mongoose/node_modules/mongodb/lib/db.js:190:19)
    at MongoStore._open_database (/dir/node_modules/connect-mongo/lib/connect-mongo.js:182:15)
    at MongoStore._get_collection (/dir/node_modules/connect-mongo/lib/connect-mongo.js:177:14)
    at /dir/node_modules/connect-mongo/lib/connect-mongo.js:194:16
    at /dir/node_modules/mongoose/node_modules/mongodb/lib/db.js:200:5
    at connectHandler (/dir/node_modules/mongoose/node_modules/mongodb/lib/server.js:272:7)
    at g (events.js:180:16)
    at EventEmitter.emit (events.js:95:17)
Sravani Lanka
  • 43
  • 1
  • 5
  • possible duplicate of [possible EventEmitter memory leak detected](http://stackoverflow.com/questions/9768444/possible-eventemitter-memory-leak-detected) – Mosho Apr 21 '15 at 08:26
  • No, i have already gone through it and tried to increase max listeners, still it did not work. – Sravani Lanka Apr 21 '15 at 08:46

1 Answers1

0

Solved... Modifying max no.of listeners did not work. The problem is with new versions of mongoose/mongodb. When i saw mongodb server, i noticed that connections are created to the DB in a continuous loop (may be due to some problem with new ones). I switched them back to the previous versions in package.json, cleared cache and installed dependencies again. Now its working.

Sravani Lanka
  • 43
  • 1
  • 5