ElementHost size causes slow wpf open/load with high memory usage

前端 未结 1 1139
小蘑菇
小蘑菇 2021-01-02 08:39

The Problem:

We have a Winforms application, which can open up another WPF Window. This window contains various icons and text and isnt overly compl

相关标签:
1条回答
  • 2021-01-02 09:35

    After some more analysis using a profiler, this article seemed to be the same issue as what I was experiencing.

    typeof(BitmapImage).Assembly.GetType("MS.Internal.MemoryPressure")
    .GetField("_totalMemory", BindingFlags.NonPublic | BindingFlags.Static)
    .SetValue(null, Int64.MinValue / 2); 
    

    Not the nicest solution, but it definitely fixed the problem.

    0 讨论(0)
提交回复
热议问题