码迷,mamicode.com
首页 > Web开发 > 详细

使用WebBrowser,内存一直增加的解决办法

时间:2015-02-04 10:51:27      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:

-- in class definition 

        [DllImport("KERNEL32.DLL", EntryPoint = "SetProcessWorkingSetSize", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
        internal static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);

        [DllImport("KERNEL32.DLL", EntryPoint = "GetCurrentProcess", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
        internal static extern IntPtr GetCurrentProcess();

-- code to call when you want to reduce the memory

            IntPtr pHandle = GetCurrentProcess();
            SetProcessWorkingSetSize(pHandle, -1, -1);

使用WebBrowser,内存一直增加的解决办法

标签:

原文地址:http://www.cnblogs.com/simadi/p/4271652.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!