Microsoft KB Archive/837331

= About Cache Manager in Windows Server 2003 =

Article ID: 837331

Article Last Modified on 10/30/2006

-

APPLIES TO


 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition

-





INTRODUCTION
This article contains information about Cache Manager in Microsoft Windows Server 2003. Virtually every modern operating system caches file system data to optimize performance. Most programs access data that is located in several local files. If the operating system brings these files in memory and keeps the files there for the duration of the program’s use, the number of disk reads and disk writes that the system must perform is minimized. Without caching, a program requires relatively expensive disk operations every time the program accesses file data.

By default, Windows Server 2003 caches all disk read and disk write operations. Cache Manager works closely with the memory manager and the file system to cache file system data in memory. This cache is flushed periodically and replaced with fresh data.



MORE INFORMATION
The Microsoft Windows Server 2003 uses the following types of file system data caching:
 * Logical block caching

This caches disk sector data in memory.
 * Virtual block caching

This caches data at the file system level instead of at the disk level.

Virtual cache size
IA-32 architecture limits the size of virtual address space to 32 bits. If your computer is configured with the /3 GB switch, 3 gigabytes (GB) of virtual address space is reserved for user mode operation, and only 1 GB is available for kernel mode operation. The virtual cache size depends on the following factors:  The physical memory in your computer. The value of the LargeSystemCache entry in the following registry subkey:

Set this value to 1 to enable this entry. The setting of the PagedPoolSize registry subkey during initialization. The use of the /3 GB switch. The boot image size. The session space size that is required for Terminal Server configuration.</ul>

The following table indicates how to calculate the virtual cache size:

The following table indicates the maximum and the minimum limits for the virtual cache size calculation:

Note The /3GB switch reduces the size of virtual cache space by approximately 10 MB.

Physical cache size
There is no limit to the physical cache size in the IA-32 and IA-64 architectures. Windows allocates physical cache memory based on the following factors:
 * Virtual cache data
 * Cached file input/output
 * The other demands that the system makes on physical memory

The physical memory that supports virtual cache data can be flushed and used for other purposes, depending on system requirements. Windows confirms that the cached data is flushed to the disk before Windows retrieves the physical memory for other purposes. As the demand for virtual cache data increases, more physical memory is allocated for virtual cache data.

Cache flush frequency
If the Cache Manager does not try to write modified file data back to a file, and free memory becomes scarce, the memory manager's modified writer thread writes the unwritten data back to a file. The system does not rely on the memory manager to flush file data back to the disk. Instead, the Cache Manager tries to write the data back to nonvolatile storage in a timely manner by using the &quot;lazy writing&quot; process. As programs modify file data, the Cache Manager keeps track of how much data is modified, or &quot;dirty.&quot; The Cache Manager writes back one-eighth of the cache's modified data to disk every second.

<div class="references_section">