المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# WPF Memory Leak



C# Programming
02-21-2013, 07:21 PM
Recently, I had to track down why all of our new WPF screens were leaking memory. I rapidly dove into this issue and soon discovered that this issue was dispeared after I run the code.
GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); Does .net not call the method?
I use the GC.CollectionCount method to get the number of times garbage collection has occurred for the 0/1/2 generation of objects and find they were 211/196/9.
It means .net Does do it.

Can somone tell me why it is occured?

Thanks,
Michael.
GC;Memory Leak