Last post Feb 11, 2017 11:20 PM by ofir.y
Jan 23, 2017 08:43 AM|ofir.y|LINK
I’ve got a signalR window service on production that’s leaking, after inspecting the memory dump I’ve found that the Clients property of the
Microsoft.AspNet.SignalR.Hubs.HubConnectionContextBase is responsible for the leak.
On my service I have multiple broadcaster classes that holds a reference to the
TypedHubConnectionContext which holds the HubConnectionContextBase.
The reference is defined like so, to avoid resolving each time the broadcaster needs the Clients property:
public class TQCBroadcaster : BaseBroadcaster, IPackage<KeyValuePair<long, ITradableClosingValues>>
private IHubConnectionContext<IPositionHubClient> contextInstance;
private IHubConnectionContext<IPositionHubClient> context
if (contextInstance == null)
contextInstance = GlobalHost.ConnectionManager.GetHubContext<PositionHub, IPositionHubClient>().Clients;
It that my problem? Do I need to remove the constant reference to the
TypedHubConnectionContext and resolve it every time it being required?
Another strange issue I’ve noticed, is on the performance counters which have the following counters:
As I understand the Connection Current Websocket/SSE/LP/FF needs to sum up to the
Connection Current counter like the image link above. That’s not the case on my Production environment, I can see a very high number on the websocket & SSE counters that is way beyond the
Connection Current counter. Which may indicate the disconnected connections doesn’t clean up properly.
Jan 24, 2017 06:42 AM|Jean Sun|LINK
The following link shows how to detect .NET application memory leaks, please take it as reference.
Feb 11, 2017 11:20 PM|ofir.y|LINK
Hi Jean, I think I know how to find a memory leak...
I've open an issue on github