t-mullen / simple-signal

Signalling solution for simple-peer with socket.io
MIT License
162 stars 27 forks source link

[simple-signal-server]: Clearing out this._sockets #28

Closed gurupras closed 4 years ago

gurupras commented 4 years ago

First, sorry if this is a totally dumb question.

I've been running into some memory leaks recently, and an amateur attempt at a heap dump image led me to this line of code. From the code below, I see that this._sockets (temporarily?) stores sockets that are amidst discovery. https://github.com/t-mullen/simple-signal/blob/ec5ff0fe9ee7e7a8bfd650f60bd47fa6e03c5017/server/src/index.js#L21-L24

but I can't seem to figure out where this._sockets is cleared out.

Does a socket disconnect somehow wipe it out? Am I somehow not releasing a reference to the sockets in my code that is in turn causing a pileup within SimpleSignalServer?

t-mullen commented 4 years ago

Yes, this is a leak. Fixed in v2.1.2