We have a production version of Blazor Server running on Azure, that extensively uses Fluxor. We were investigating a memory leak and have found that the application is holding on to Flxuor Subscriptions preventing the subscription from being removed through the GC.
Screenshot shows 15K Fluxor.DisposableCallbacks in the "Finalizable objects require multiple garbage collection to clean up and may cause performance issues" memory analysis report on Azure after 15 hours of up time and a maximum of 40 users.
We did some digging and found that if we tweaked the UnsubscribeFromAllActions in ActionSubscriber.cs class to include:
IEnumerable<object> subscribedInstances =
instanceSubscriptions
.Select(x => x.Subscriber)
.Distinct();
foreach (object subscription in subscribedInstances)
{
if (SubscriptionsForInstance.ContainsKey(subscription))
SubscriptionsForInstance.Remove(subscription);
}
The Fluxor.DisposableCallbacks dropped to around 700
We have a production version of Blazor Server running on Azure, that extensively uses Fluxor. We were investigating a memory leak and have found that the application is holding on to Flxuor Subscriptions preventing the subscription from being removed through the GC. Screenshot shows 15K Fluxor.DisposableCallbacks in the "Finalizable objects require multiple garbage collection to clean up and may cause performance issues" memory analysis report on Azure after 15 hours of up time and a maximum of 40 users.
We did some digging and found that if we tweaked the UnsubscribeFromAllActions in ActionSubscriber.cs class to include:
The Fluxor.DisposableCallbacks dropped to around 700
Complete Class: ActionSubscriber.txt
Would you consider adding this to your codebase?