【翻译】系统文件缓存耗用大量物理内存问题
原文出处:http://support.microsoft.com/kb/976618
原文标题:当系统文件缓存耗用大量物理 RAM,您会遇到应用程序和服务的性能问题(You experience performance issues in applications and services when the system file cache consumes most of the physical RAM)
由于微软的机器翻译实在太烂,所以人工翻译了一下。
现象
您会在各种版本的 Windows XP、 Windows vista、 Windows Server 2003,Windows Server 2008 和 Windows Server 2008 R2 中遇到应用程序中和服务的性能问题。
此外,您还会发现下列现象:
- 可用内存是几乎耗尽。
- 系统文件缓存耗用大量物理内存。
- 存在持续且大量的对磁盘卷的进行缓存读取的请求。
原因
Windows 系统使用基于需求的的内存管理算法。如果任何进程请求并使用大量的内存,该进程的工作集(物理内存中可用内存页面数)就会增大。如果这些请求持续且未受抑制,那么进程的工作集(working set)将增长至占用所有的物理内存。在这种情况下,其他进程的工作集(working set)将调出到硬盘上。这种现象将降低应用程序和服务的性能,因为内存页总是在不断的写入磁盘又从磁盘中读出。
这种现象也适用于系统文件缓存的工作集。如果有任何进程或驱动程序持续且大量的对磁盘卷的进行缓存读取的请求,系统文件缓存的工作集将增长以满足这一需求。系统文件缓存消耗物理内存从而导致其他进程没有足够的物理内存量。
早于Windows Vista的32位Windows系统中,系统文件缓存的工作集有一个小于 1GB的理论上限。
32位的Windows Vista系统动态分配核心资源。
64 位的Windows 操作系统中虚拟地址范围的大小大于通常的物理内存。
解决方案
解决此问题需要使用GetSystemFileCacheSize API 函数和SetSystemFileCacheSize API 函数来设置系统文件缓存工作集的最大值或最小大小值。这些函数是唯一可以限制系统文件缓存对物理内存消耗的方法。
Microsoft Windows Dynamic Cache Service 用来演示一种使用这些 Api 来尽量减少此问题影响的策略的示例服务。
安装和使用 Microsoft Windows Dynamic Cache Service不会导致微软拒绝支持您的系统。提供此服务和它的源代码作为示例,说明如何使用 这些Api 来减少文件系统缓存的增长。
可以通过下面的链接下载服务和源码:
http://www.microsoft.com/downloads/details.aspx?FamilyID=e24ade0a-5efe-43c8-b9c3-5d0ecb2f39af&displaylang=en
更多信息
在Windows 7 和 Windows Server 2008 R2 操作系统的内存管理算法已更新,可以解决很多系统文件缓存在以前版本的 Windows 中发现的问题。只有某些特殊的情况,您才需要在计算机正在运行 Windows 7 或 Windows Server 2008 R2 上实现此服务时。
如何确定您的系统受此问题影响
通过下列网址下载的SysInternals RamMap 工具,并将其安装在您的系统:
http://technet.microsoft.com/en-us/sysinternals/ff700229
安装、卸载该工具均无需重启。运行该工具,选择"Use Counts"视图,该视图将显示多个数据列以阐释当前的内存使用情况。单击"Active"列根据字节数进行排序,并关注Total列中使用率最高的项。
如果正在使用大量内存的是"Metafile",说明您遇到了上述系统文件高速缓存问题。同时我们还可以使用性能监视器监控Memory\System Cache Resident Bytes counter 观察缓存持续增长的现象来确认正在遭受此问题。
RamMap 的下列输出说明计算机出现此问题:

RamMap 的下列输出说明计算机未出现此问题:

使用性能监视器监控Memory\System Cache Resident Bytes counter示例:




适用此问题的操作系统:
- Microsoft Windows XP Professional x64 Edition
- Windows Vista Home Basic
- Windows Vista Home Premium
- Windows Vista Business
- Windows Vista Enterprise
- Windows Vista Ultimate
- Windows Vista Home Basic 64-bit edition
- Windows Vista Home Premium 64-bit edition
- Windows Vista Enterprise 64-bit edition
- Windows Vista Ultimate 64-bit edition
- Microsoft Windows Server 2003 R2 Datacenter Edition (64-Bit x86)
- Microsoft Windows Server 2003 R2 Enterprise Edition (64-Bit x86)
- Microsoft Windows Server 2003 R2 Standard Edition (64-Bit x86)
- Microsoft Windows Server 2003, Datacenter x64 Edition
- Microsoft Windows Server 2003, Enterprise x64 Edition
- Microsoft Windows Server 2003, Standard x64 Edition
- Microsoft Windows Server 2003, Datacenter Edition for Itanium-Based Systems
- Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
- Windows Server 2008 Datacenter without Hyper-V
- Windows Server 2008 Enterprise without Hyper-V
- Windows Server 2008 Standard without Hyper-V
- Windows Server 2008 Datacenter
- Windows Server 2008 Enterprise
- Windows Server 2008 Standard
- Windows Server 2008 for Itanium-Based Systems
- Windows Server 2008 R2 Datacenter
- Windows Server 2008 R2 Enterprise
- Windows Server 2008 R2 Service Pack 1
- Windows Server 2008 R2 Standard
浙公网安备 33010602011771号