美文网首页
WPF内存释放

WPF内存释放

作者: 维京崛起 | 来源:发表于2018-01-24 10:11 被阅读0次

WPF内存释放

    GC.Collect();
    
    GC.WaitForPendingFinalizers();
    
    if (Environment.OSVersion.Platform == PlatformID.Win32NT)
    
    {
    
      SetProcessWorkingSetSize(System.Diagnostics.Process.GetCurrentProcess().Handle, -1, -1);
    
    }
    
    [DllImport("kernel32.dll")]
    
    private static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max);

相关文章

网友评论

      本文标题:WPF内存释放

      本文链接:https://www.haomeiwen.com/subject/qobyaxtx.html