摘要: [转]关于 SetProcessWorkingSetSize 和内存释放在应用程序中,往往为了释放内存等,使用一些函数,其实,对于内存操作函数要谨慎使用,比如大家常常想到的 SetProcessWorkingSetSize,其实对于windows来说,系统会自动在程序闲置时(如程序被最小化)释放内存的,自己用内存释放 时,往往会造成一些莫名的内存错误,造成自己的应用程序及系统不稳定。具体原理有人已经写得很清楚了,以下为转帖的几个帖子,供参考:=============================================1、将物理内存的占用挪到虚拟内存里-----揭密篇将物理内存的占 阅读全文
posted @ 2013-08-09 10:07 jojinshallar 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 摘自:http://xuxuhuy.blog.163.com/blog/static/1032932920116110204080/ [System.Runtime.InteropServices.DllImport("kernel32.dll")] public static extern bool SetProcessWorkingSetSize(IntPtr proc, int min, int max); public void FlushMemory() { GC.Collect(); GC.Wai... 阅读全文
posted @ 2013-08-09 09:59 jojinshallar 阅读(609) 评论(0) 推荐(0) 编辑