You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible that Fluxor Store instances are not garbage collected?
I tested large blazor server app and instances of Store, App, etc. are kept in memory, so I started investigating where is the problem...
Maybe problem is in my test, since I monitored memory while pressing F5 in browser, just to check if there is some potential problem :)
How to reproduce:
Create new blazor server project, in VS profile memory. While pressing F5 and comparing memory snapshots, there is always only 1 instance of App class and memory looks clean.
Now add Fluxor in the mix like:
builder.Services.AddFluxor(o =>
{
o.ScanAssemblies(/main assembly/);
}
And add
<Fluxor.Blazor.Web.StoreInitializer /> to App.razor
Retry VS memory profile while hitting F5 and Store instances are not GC-ed even though Dispose methods are being called (2x per store instance?). I couldn't find what is holding reference to instances, it looks like sth in DI system..., it could be that blazor is not recycling connections / instances, but don't know why app without fluxor is not showing such symptoms maybe because fluxor is using JS calls and blazor connection lifecycle is not GCed instantly...
I looked all of the source code of Fluxor but couldn't find some obvious problem... maybe problem even does not exist, but adding fluxor to an app changes memory footprint / consumption quite a bit...
Does anyone have an idea, why memory would behave like that absent some obvious memory leak?
Regards.
The text was updated successfully, but these errors were encountered:
Ok I found out what is the root cause of my observations. It's not about user reconnecting, but System.Text.Json caching some stuff in .NET 7. That's why behaviour is totally unexpected...
Hi.
Is it possible that Fluxor Store instances are not garbage collected?
I tested large blazor server app and instances of Store, App, etc. are kept in memory, so I started investigating where is the problem...
Maybe problem is in my test, since I monitored memory while pressing F5 in browser, just to check if there is some potential problem :)
How to reproduce:
Create new blazor server project, in VS profile memory. While pressing F5 and comparing memory snapshots, there is always only 1 instance of App class and memory looks clean.
Now add Fluxor in the mix like:
builder.Services.AddFluxor(o =>
{
o.ScanAssemblies(/main assembly/);
}
And add
<Fluxor.Blazor.Web.StoreInitializer /> to App.razor
Retry VS memory profile while hitting F5 and Store instances are not GC-ed even though Dispose methods are being called (2x per store instance?). I couldn't find what is holding reference to instances, it looks like sth in DI system..., it could be that blazor is not recycling connections / instances, but don't know why app without fluxor is not showing such symptoms maybe because fluxor is using JS calls and blazor connection lifecycle is not GCed instantly...
I looked all of the source code of Fluxor but couldn't find some obvious problem... maybe problem even does not exist, but adding fluxor to an app changes memory footprint / consumption quite a bit...
Does anyone have an idea, why memory would behave like that absent some obvious memory leak?
Regards.
The text was updated successfully, but these errors were encountered: