Windows内存映射文件 [英] Windows Memory Mapped Files

查看:281
本文介绍了Windows内存映射文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试调查Windows Kernel关于内存映射文件"/虚拟内存"的行为.特别是,我有兴趣确定内存映射文件的内容(由Windows)刷新到磁盘的频率以及Windows用于确定是否应该这样做的标准.

I am trying to investigate the behaviour of the Windows Kernel with respect to Memory Mapped Files / Virtual Memory. Specifically I am interested in determining how frequently the contents of a memory mapped file are flushed (by Windows) to disk and what criterion Windows uses for deciding it is time to do so.

我已经在网上做了一些研究,除了MSDN专门处理如何和为什么"而不是详细介绍内部工作原理之外,似乎没有太多的信息.如果有人可以将我指向任何文章,或者以前曾经研究过它并且有一定见识,那么我将很欢迎.

I have done a bit of research online and, apart from the MSDN which deals more with the 'hows and whys' rather than detailing the internal workings, there doesn't appear to be much information. If anyone can point me to any articles or has looked into this before and has some insight I would welcome it.

谢谢.

推荐答案

内存映射文件由内核中修改后的页面编写器控制-每当需要重新使用支持页面的内存时,它们都会被刷新.它可能会在内存压力下发生.

Memory mapped files are controlled by the modified page writer in the kernel - they're flushed whenever the memory that backs the page needs to be re-used (so it can happen under memory pressure).

系统还会跟踪脏页数,并在达到阈值后将其写入.

The system also keeps track of the number of dirty pages and writes them after a threshold is reached.

您可以在这篇关于Windows Vista的Windows内存管理更改的文章-它不会直接回答您有关内存管理器如何处理已修改页面的问题,但是您可以根据文章中的信息推断出一些详细信息

You can find more information about in this article about Windows memory management changes for Windows Vista - it doesn't directly answer your question about how the memory manager treats modified pages but you can infer some of the details based on the information in the article.

这篇关于Windows内存映射文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆