I have a application that's using a lot of memory, but for now I cannot change this fact. My problem is that I have an operation I'd like to perform and provide a progress dialog but it appears that displaying the xaml progress window is causing GC.Collect
to be called 10 times! Any ideas how I can optimize opening my progress window?
According to my Ants Profiler the calls leading up to GC.Collect are
System.Window.ShowDialog() ->
..
..
System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap ->
SafeMILHandle.UpdateEstimatedSize ->
SafeMILHandleMemoryPressure.ctor ->
MemoryPressure.Add ->
MemoryPressure.ProcessAdd ->
GC.Collect
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…