Hi,
I am using the Diagnostic tools in Visual Studio. I have a command linked to a button which I use to do GC.Collect() before I take the memory snapshot. Basically I will add one viewmodel, then remove it. I then add 5 copies of the same viewmodel, take a memory snapshot, remove the five copies, run GC.Collect() and then take another snapshot.
I have been working on this today and I discovered that if I call GC.Collect() twice (not sure why I tried this, but I did) then the viewmodels are removed. I don't profess to be an expert on GC but I didn't expect calling GC.Collect() twice to make any difference, but it does make me slightly less concerned if that makes any sense!
Note that I have updated the sample since first posting.
Thanks
I am using the Diagnostic tools in Visual Studio. I have a command linked to a button which I use to do GC.Collect() before I take the memory snapshot. Basically I will add one viewmodel, then remove it. I then add 5 copies of the same viewmodel, take a memory snapshot, remove the five copies, run GC.Collect() and then take another snapshot.
I have been working on this today and I discovered that if I call GC.Collect() twice (not sure why I tried this, but I did) then the viewmodels are removed. I don't profess to be an expert on GC but I didn't expect calling GC.Collect() twice to make any difference, but it does make me slightly less concerned if that makes any sense!
Note that I have updated the sample since first posting.
Thanks