Open Discolai opened 1 year ago
Hey @Discolai ,
thank you for reporting this with the useful code snippet. I have broken the recursive call by introducing an error timer, and it seems to solve the problem nicely here: df2e007c103f248e2be3f4f35460a9033ad9469d
Before:
After:
Hi,
I am using this library in an application where a client might stay in a reconnection state over several days. The built in reconnection logic calls the
WebsocketClient.StartClient
method recursively. This leads to a steady increase in memory allocation after each reconnect attemptThe following code snippet creates 10 000 clients which reconnects every 100 milliseconds. It is not a real life scenario, but it demonstrates the issue. It managed to allocate 600MB in 30 sek