mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.23k stars 139 forks source link

Update ActionSubscriber to reduce Fluxor.DisposableCallbacks (Fixes #378) #379

Closed sallyjwhite closed 1 year ago

sallyjwhite commented 1 year ago

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. Memory analysis report shows 15K Fluxor.DisposableCallbacks in the "Finalizable objects require multiple garbage collection to clean up and may cause performance issues" after 15 hours of up time and a maximum of 40 users. With this change it drops to around 700. This wasn't the cause our memory leak. Our memory leak prevented the whole session from being disposed. This meant before the memory leak was resolved, we had 250K instances of Fluxor.DisposableCallbacks which is what led us to investigate in the first place

mrpmorris commented 1 year ago

Hi

You've replaced tabs with spaces, I wanted the opposite. I use tabs :)

sallyjwhite commented 1 year ago

Hope that's sorted it - seems to be messing up the formatting when updated on githib

mrpmorris commented 1 year ago

Merged into 5.7 - thank you for your help!