ElectronicObserverEN / ElectronicObserver

Electronic Observer is a game viewer for Kantai Collection.
Other
84 stars 20 forks source link

DataGridViewModel memory leak #435

Open myangelkamikaze opened 9 months ago

myangelkamikaze commented 9 months ago

There seems to be a memory leak if you don't clear out ItemsSource manually: https://github.com/ElectronicObserverEN/ElectronicObserver/commit/326cc2c67dc0d07191fbbc7853d03400db8c393b

Reproduction:

  1. Open sortie record viewer
  2. Fetch all sorties
  3. Select all sorties (ctrl+A) - in my case with about 30k records the EO memory went from about 500MB to about 800MB
  4. Close sortie record viewer

Without cleaning the DataGridViewModel ItemsSource, the memory stays at 800MB forever. Cleaning it up manually drops the memory down back to 500MB after about 5 minutes or so (might be able to speed this up with GC.Collect).

I didn't investigate this in detail, so there might be a better solution than manually clearing ItemsSource.