Home > Net >  WPF ItemsSource memory leak
WPF ItemsSource memory leak

Time:02-10

so this suddenly started to happen. And is breaking all of my applications. I tested the program on multiple machines, same issue everywhere.

If you bind ObservableCollection to any ItemsSource, add items, remove them, add, then views and viewmodels are slowly leaking, not really on demand.

I have made project showcasing the issue. The amount of objects added might seem drastic, but it is just to speedup the memory leak.

https://github.com/tomasfil/ReactiveUI_Tests/tree/WithoutReactiveUI/ReactiveUI_DataGrid_MemoryLeak

Under the branch "WithoutReactiveUI" is also .net framework 4.8 project, it happens on any .net version and tested it on VS2019 and VS2022.

Can anyone confirm the memory leak? If so maybe someone might be able to pin point why that happens.

The net48 project is just blank project and added logic directly to MainWindow.

I am posting this from github to stack overflow hoping to speed up the resolution. Because if this is wpf app it must be from some point breaking s*load of applications.

CodePudding user response:

  •  Tags:  
  • Related