现在写一个使用CHtmlView类显示并捕捉保存到图片的MDI软件,但是发现了一个问题:当同时开启几个VIEW工作时,使用的内存非常大,最高时开启5个页面达到120M,手工关闭ChildFrame之后也不能回收,但是最小化窗口之后再使窗口正常化,使用的内存大概只有8M左右.我使用的CMyHtmlView已经是Fix过的了,new出来也delete了,应该也不是Memory Leak的问题,,按照现象似乎是和界面相关的一些资源没有被释放?在MSDN,CSDN和网上都查了很多资料了,也没有得到明确的答案.但是这里以前有人说也出现了这样的情况,比较腾讯的IE内核浏览器就似乎可以回收这部分资源,但是我没有试验过.请教各位高人,有没有知道怎么处理的啊?
http://windowssdk.msdn.microsoft.com/en-us/library/ms686237.aspx
dwMinimumWorkingSetSize
......
If both dwMinimumWorkingSetSize and dwMaximumWorkingSetSize have the value (SIZE_T)-1, the function temporarily trims the working set of the specified process to zero. This essentially swaps the process out of physical RAM memory.The full story is too complicated to go into here, but you can read about it in MSDN online or in any advanced book on Windows internals (memory manager). The memory isn't actually de-allocated, it is just ed as "available for other apps". If there is no memory pressure from other applications, then the pages will stay in physical RAM and they'll be available immediately when you restore the application. If there is a lot of memory pressure, the pages that were freed will be re-used by another application. In that case, restoring your application from its minimized state will be slower because the memory has to be "paged back in" from disk.
这些差不多都用是的page file