Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Memory Leak in MVVM design pattern suggested by Josh Smith at MSDN

$
0
0
 
 

I m able to find memory leak in MVVM design pattern described in Model view view model design pattern

In sample application provide by msdn, everytime i open same a view it claims new memory but when i close it, memory is not/never collected by GC. To regenerate same follow below steps:

  1. Run downloaded application MVVMDemoApp.
  2. Click on View All Customers (Note memory usage by application after)
  3. Close All Customers Tabitem (Note Memory is not claimed back by GC)
  4. Again Click on View All Customers (Note memory usage is again increased)
  5. Repeat Steps 3 & 4 many times (Please note memory usage is increasing every time almost every time)
  6. Force GC.Collect(); Gc.WaitForFinalizers(); (even after waiting for long & forcing GC many times. memory usage is not reduce at step2's usage.)

Please help me to understand the reason behind this leaking memory.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>