(node:49860) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup list

1,792 views
Skip to first unread message

Daniel

unread,
Oct 9, 2017, 1:34:36 PM10/9/17
to node-apn
I need to send a significant volume of notifications.  Historically, we've used SNS to make this happen, but it's a pain to use and correlate with successes and failures.  After some searching, I ventured out and found node-apn.  It took about 15 minutes to get certs, make a simple app, and receive my first notification.  I was thrilled.

Pretty quickly, I started getting errors when performing a mass send: (node:49860) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added. Use emitter.setMaxListeners() to increase limit.

We need to send out 10000+ notifications daily, and node-apn seemed to choke on 10000, 1000, and even batches of 100.  I've promisified the smaller-batch sends, but seeing as provider startup and shutdown processes are not promises, I have no way to neatly make this happen.  Can someone provide some guidance?

Thanks much!

Nick

unread,
Oct 18, 2017, 8:05:53 PM10/18/17
to node-apn
Daniel,

Looks like it is a known issue that many people are facing:


I believe that it can keep sending out Apple Push Notifications after the warning.

I did some memory usage monitoring of just leaving the Provider connection open.  There was not a noticeable memory loss so I am going to ignore it until they find a fix for it in that thread.

- Nick

Daniel

unread,
Oct 25, 2017, 9:30:48 PM10/25/17
to node-apn
After a certain point, it failed entirely.  But, when you're sending out 10000+ notifications, it's not that easy when your sending (and, thus, logging) fails to send another notification.  I have ended up using a different library, and while there are still some technical challenges with it (https://github.com/AndrewBarba/apns2), it has been solid.

Nick

unread,
Oct 30, 2017, 8:51:20 PM10/30/17
to node-apn
Daniel,

Thanks for the heads up.  I will be keeping an eye on it for us.
Reply all
Reply to author
Forward
0 new messages