-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Memory leak on SignalR #3850
Comments
SignalR has a per-connection ring buffer where it stores messages. This default size of the buffer is 1000 messages (per connection). What you are probably seeing is that buffers are filling up and messages will be freed up (actually be replaced by new messages) once the buffers are full. You can configure the size of the buffer using IConfigurationManager.DefaultMessageBufferSize configuration property. The minimum size of the buffer is 32 (enforced by SignalR). Note that decreasing the size of the buffer increases the likelihood of missing messages (e.g. during reconnects). |
thanks mate, I've read about that ring buffer, I would try to decrease the buffer size to the minimum allowed by SignalR (32) as I have no need of this buffer, my client keeps track of all his current subscriptions, if a reconnect occurs it subscribes again to the relevant groups & events. |
I do have a few questions regarding the ring buffer:
|
|
Thanks for your answers moozzyk! After a week on Production with the new configuration I can confirm we have no more memory leakage. But I think you guys seriously needs to consider this as a design issue... |
Definitely something we're addressing with SignalR for ASP.NET Core. |
@moozzyk @OfirYemini What was your configuration on server hub? Is there anything out of changing |
Changing the DefaultMessageBufferSize is the only thing required to make the buffers smaller. |
yes Roman, it helped |
Hi all,
Issue could be related to #3589
We have a signalR version 2.2.0 hosted as a window service, the service is pushing trading rates on a high frequency intervals to a hundreds of browser clients. So we have a lot of connections come and go. after a while, the service starts to leak.
I've captured the dump and compared it to base dump that was taken a few minutes after the service was started. below are the results:
As you can see, SignalR classes are at the top.
link to the second dump is here:
The text was updated successfully, but these errors were encountered: