socketio / socket.io

Realtime application framework (Node.JS server)
https://socket.io
MIT License
60.88k stars 10.09k forks source link

If the server's upstream bandwidth is used up, it will generate a large number of pingTimeoutTimers, which in turn will cause memory leaks #4937

Open introspection3 opened 7 months ago

introspection3 commented 7 months ago

Describe the bug If the server's upstream bandwidth is used up, it will generate a large number of pingTimeoutTimers, which in turn will cause memory leaks

To Reproduce

If the server's upstream bandwidth is used up, it will generate a large number of pingTimeoutTimers,

Socket.IO server version: 4.5

image

Expected behavior work

Platform: debian

Additional context Add any other context about the problem here.

darrachequesne commented 7 months ago

When the bandwidth is used up, I think that the heartbeat mechanism will fail and the connections will be closed with the reason "ping timeout", and then everything should be properly garbage collected. Isn't that what you are experiencing?

Reference: https://nodejs.org/en/guides/diagnostics/memory/