Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange memory leak related to DataContext and PropertyChanged event
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COIt looks like your solution to set `ObjectTrackingEnabled = false` is the best solution. Realize that the context keeps a hold of all objects that it fetches so that it can watch for changes. Just disposing it doesn't remove the event hooks on INotifyPropertyChanged/INotifyPropertyChanging thus they are retained longer than they should be. Since you don't need the change tracking, removing it should not only fix your memory leak, but improve performance as well.
      singulars
    2. COI have also seen this scenrio exactly how you describe it. In my situation I had to go through a few places where a small "using" statement was used to work with the datacontext, and use the ObjectTracking=false option. I was using Ants profiler and saw the number of instances of a particular class within the datacontext continually climb.
      singulars
    3. COAre you using the entities outside of the using(...) scope in which the DataContext is declared? Just because you kill off the data context, references to other things may exist. If you are using the entities outside the data context scope, you need to create non-LINQ / POCO classes that mirror the data model and deep copy into these. If you want examples, I can provide them.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload