You experience performance issues in applications and services when the system file cache consumes most of the physical RAM

Article ID: 976618 - View products that this article applies to.
Expand all | Collapse all

Symptoms

You experience performance issues in applications and services in various versions of Windows XP, of Windows Vista, of Windows Server 2003, Windows Server 2008 and Windows Server 2008 R2. Additionally, you notice the following symptoms:
  • Available memory is almost exhausted.
  • The system file cache consumes most of the physical RAM.
  • There is a continuous and high volume of cached read requests to the hard disk.

Cause

Memory management in Microsoft Windows operating systems uses a demand-based algorithm. If any process requests and uses a large amount of memory, the size of the working set (the number of memory pages in the physical RAM) of the process increases. If these requests are continuous and unchecked, the working set of the process will grow to consume all the physical RAM. In this situation, the working sets for all the other processes are paged out to the hard disk. This behavior decreases the performance of applications and services because the memory pages are continuously written to the hard disk and read from the hard disk.

This behavior also applies to the working set of the system file cache. If there is a continuous and high volume of cached read requests from any process or from any driver, the working set size of the system file cache will grow to meet this demand. The system file cache consumes the physical RAM. Therefore, sufficient amounts of physical RAM are not available for other processes.

On 32-bit versions of Microsoft Windows operating systems earlier than Windows Vista, the working sets of the system file cache have a theoretical memory limit of less than1 GB. The limitation of the virtual address range prevents the working sets of the system file cache from exhausting the physical RAM.

On 32-bit versions of Windows Vista operating systems, kernel resources are allocated dynamically. The working set of the system file cache increases to consume the virtual address range of the kernel mode at the expense of other kernel resources. The limitation of this memory range is less than 2 GB. If the computer has more than 2 GB of physical RAM, the cache cannot exhaust all the physical RAM. However, the cache can exhaust the virtual address space in the kernel. This can cause allocation failures for other kernel components.

On 64-bit versions of Windows operating systems, the size of the virtual address range is typically larger than the physical RAM. In this situation, the working set for the system file cache can increase to consume most of the physical RAM.

Workaround

To work around this issue, use the GetSystemFileCacheSize API function and the SetSystemFileCacheSize API function to set the maximum or minimum size value for the working sets of the system file cache. The use of these functions is the only supported method to restrict the consumption of physical memory by the system file cache.

The Microsoft Windows Dynamic Cache Service is a sample service that demonstrates one strategy to use these APIs to minimize the effects of this issue.

Installing and using the Microsoft Dynamic Cache Service does not cause the exclusion of support for Microsoft Windows. This service and its source code are provided as an example of how to use the Microsoft supported APIs to reduce the growth of the file system cache.

The service and source code can be downloaded from the following link in the Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?FamilyID=e24ade0a-5efe-43c8-b9c3-5d0ecb2f39af&displaylang=en

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More information

The memory management algorithms in Windows 7 and Windows Server 2008 R2 operating systems were updated to address many file caching problems found in previous versions of Windows. There are only certain unique situations when you need to implement this service on computers that are running Windows 7 or Windows Server 2008 R2.

How to Determine That Your System is Affected

Download the SysInternals RamMap tool from the website below and install it on your system:

http://technet.microsoft.com/en-us/sysinternals/ff700229

When you run the tool, select “Use Counts” and there will be several columns displayed that illustrate the current pattern of memory usage. Click on the “Active” column to sort by the number of bytes used, and note the top usage directly under the total.

If the top use count is “Metafile” and a large portion of memory is being used, then you are experiencing the System File Cache issue described above. This can also be confirmed using Performance Monitor and monitoring the Memory\System Cache Resident Bytes counter and seeing the cache grow continuously over time.

Example RamMap output where the computer is experiencing the issue:
Collapse this imageExpand this image





Example RamMap output where the computer is not experiencing the issue:
Collapse this imageExpand this image




Performance Monitor can also be used to assist in determining the computer is experiencing the issue described above. Load Performance Monitor and monitor the Memory\System Cache Resident Bytes counter over a period of time. If the counter shows an upward trend over time then the computer is experiencing the issue, as shown below:

Collapse this imageExpand this image


If your Windows Server 2008 R2 system is experiencing this issue, you may contact Microsoft Technical Support to obtain the Dynamic Cache Service for Windows Server 2008 R2.


Restart requirements

You do not have to restart the computer when you install, uninstall or use this service.


Properties

Article ID: 976618 - Last Review: October 15, 2012 - Revision: 7.0
Applies to
  • 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 x64 Edition
  • Microsoft Windows Server 2003 R2 Enterprise x64 Edition
  • Microsoft Windows Server 2003 R2 Standard x64 Edition
  • 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
Keywords: 
kbexpertiseinter kbtshoot kbsurveynew kbprb KB976618

Give Feedback