A page file is an optional, hidden system file on the hard disk. The following image shows an example of a page file:
Page files have two primary roles, physical extension of RAM and support for system crash dumps.
Physical extension of RAM
Page files extend how much "Committed memory" (also known as "Virtual Memory") is used to store modified data.
Additionally, page files enable Windows to remove infrequently accessed modified pages from physical memory to let the system use physical memory more efficiently for frequently accessed pages.
Page files are necessary in the following two special scenarios.
Some products or services require a page file for various reasons. For specific information, check the product documentation.
For example, the following Windows servers need page files:
- Windows Server domain controllers
- DFS Replication (DFS-R) servers
- Certificate servers
- ADAM/LDS servers
This is because the algorithm of the database cache for Extensible Storage Engine (ESENT, or ESE in Microsoft Exchange Server) depends on the "\Memory\Transition Pages RePurposed/sec" performance monitor counter. A page file is required to make sure that the database cache can release memory if other services or applications request memory.
In summary, page file sizing depends on the system crash dump file setting requirements and the system commit charge peak usage or expected usage. Both considerations are unique to each system, even for systems that are identical to other systems. This means that page file sizing is unique to each system and cannot be generalized.
Hyper-V parent partition (hosts)
- Windows Server Datacenter Core, version 1709 with Hyper-V role enabled (also known as Hyper-V Parent Partition, Hyper-V Host)
- Windows Server 2016 with Hyper-V role enabled (also known as Hyper-V Parent Partition, Hyper-V Host)
- Windows 10 with Hyper-V role enabled
Support for system crash dumps
Page files record information about the state of the computer when Windows crashes. The following is an example of the dump file:
Note When large physical memory is installed, a page file might not be required to support the system commit charge during peak usage. The available physical memory alone might be large enough. However, a page file or a dedicated dump file might still be required to support a system crash dump.
Use the following considerations for page file sizing for all versions of Windows and Windows Server:
Crash dump setting: If you want a crash dump file to be created during a system crash, a page file or a dedicated dump file must exist and be large enough to support the system crash dump setting. Otherwise, a system memory dump file is not created.
Peak system commit charge: The system commit charge cannot exceed the system commit limit. This limit is the sum of physical memory (RAM) and all page files combined. If no page files exist, the system commit limit is slightly less than the physical memory that is installed. Peak system-committed memory usage can vary greatly between systems. Therefore, physical memory and page file sizing also vary.
Quantity of infrequently accessed pages: A page file exists to support infrequently accessed modified pages so that they can be removed from physical memory. This provides more available space for frequently accessed pages. The "\Memory\Modified Page List Bytes" performance counter measures, in part, the number of infrequently accessed modified pages that are destined for the hard disk. However, be aware that not all the memory on the modified page list is written to disk. Typically, several hundred megabytes of memory remains resident on the modified list. Therefore, consider extending or adding a page file if all the following conditions are true:
More available physical memory (\Memory\Available MBytes) is required.
The modified page list contains lots of memory.
The existing page files are fairly full (\Paging Files(*)\% Usage).
System committed memory
The system commit memory limit is the sum of physical memory and all page files combined. It represents the maximum system-committed memory (also known as the "system commit charge") that the system can support.
The system commit charge is the total committed or "promised" memory of all committed virtual memory in the system. If the system commit charge reaches the system commit limit, the system and processes might not get committed memory. This condition can cause freezing, crashing, and other malfunctions. Therefore, make sure that you set the system commit limit high enough to support the system commit charge during peak usage.
The system commit charge and system commit limit can be measured on the Performance tab in Task Manager or by using the "\Memory\Committed Bytes" and "\Memory\Commit Limit" performance counters. The \Memory\% Committed Bytes In Use counter is a ratio of \Memory\Committed Bytes to \Memory\Commit Limit values.
Note System-managed page files automatically grow up to three times physical memory or 4 GB (whichever is larger) when the system commit charge reaches 90 percent of the system commit limit. This assumes that enough free disk space is available to accommodate the growth.
System crash dumps
A system crash (also known as a “bug check” or a "Stop error") occurs when the system cannot run correctly. The dump file that is produced from this event is called a system crash dump. A page file or dedicated dump file is used to write a crash dump file (memory.dmp) to disk. Therefore, a page file or a dedicated dump file must be large enough to support the kind of crash dump selected. Otherwise, the system cannot create the crash dump file.
Note During startup, system-managed page files are sized respective to the system crash dump settings. This assumes that enough free disk space exists.
System crash dump setting
Minimum page file size requirement
Small memory dump (256 KB)
Kernel memory dump
Depends on kernel virtual memory usage
Complete memory dump
1 x RAM plus 257 MB*
|Active Memory Dump|| |
Automatic memory dump
Depends on kernel virtual memory usage. For more information, see Automatic memory dump.
* 1 MB of header data and device drivers can total 256 MB of secondary crash dump data.
Automatic memory dump
Windows 8 and Windows Server 2012 introduced the “Automatic memory dump” feature, which is enabled by default. This was a new setting, not a new kind of crash dump. This setting automatically selects the best page file size, depending on the frequency of system crashes.
The Automatic memory dump setting at first selects a small paging file size, which would accommodate the kernel memory most of the time. If the system crashes again within four weeks, the Automatic memory dump feature selects the page file size as either the RAM size or 32 GB, whichever is smaller.
Note In Windows 8.1 and Windows Server 2012 R2, the initial minimum size of the page file or the dedicated dump file is 1 GB.
Kernel memory crash dumps require enough page file space or dedicated dump file space to accommodate the kernel mode side of virtual memory usage. If the system crashes again within four weeks of the previous crash, a complete memory dump is selected at restart. This requires a page file or dedicated dump file of at least the size of physical memory (RAM) plus 1 MB for header information plus 256 MB for potential driver data to support all the potential data that is dumped from memory. Again, the system-managed page file will be increased to handle this kind of crash dump. If the system is configured to have a page file or a dedicated dump file of a specific size, make sure that the size is sufficient to support the crash dump setting that is listed in the table earlier in this section together with and the peak system commit charge.
The following is an example of the settings in Windows Server 2016:
In this example, the system has 8 GB of RAM installed. Thus, the committed limit memory is listed as 10 GB (8 GB RAM+2 GB of page file).
For more information about system crash dumps, click the following article number to go to the article in the Microsoft Knowledge Base:
969028 How to generate a kernel or a complete memory dump file in Windows Server 2008 and Windows Server 2008 R2
Active Memory Dump
You may have the following challenges when you try to capture a complete (user and kernel) memory dump on a host computer that has a large amount of memory (128 GB to 2 TB of RAM):
- You run out of space to create the dump file.
- It takes too long to compress the dump file.
- It takes too long to copy the file and upload it for analysis.
An active memory dump is like a complete memory dump, but it filters out the pages that are unlikely to be relevant to troubleshooting problems on the host computer. Because of this filtering, it's typically significantly smaller than a complete memory dump.
Active dumps don't include pages on the free and zeroed lists, the file cache, guest virtual machine pages, and various other kinds of memory that are unlikely to be useful during debugging.
Active dumps are not strictly related to Failover Clustering or Hyper-V. However, using active dumps on Failover Clustering or Hyper-V provides the most benefits because Failover Clustering or Hyper-V tends to be installed on hosts that have a lot of RAM (128 GB to 2TB of RAM).
For example, when you debug "Hyper-V Parent Partition (Host)", the VM child partition (guest) memory pages are not important for diagnosing most problems.
You can configure Active memory dump by using one of the following options:
Graphic user interface
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CrashControl\CrashDumpEnabled (dword) 1FilterPages (dword) 1
Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Control\CrashControl -Name CrashDumpEnabled -value 1Set-ItemProperty -Path HKLM:\System\CurrentControlSet\Control\CrashControl -Name FilterPages -value 1
Note A restart is required for the changes to take effect.
For more information, see Active Memory Dump and Windows Server 2016 Failover Cluster Troubleshooting Enhancements – Active Dump.
Dedicated dump files
Computers that are running Microsoft Windows or Microsoft Windows Server usually must have a page file to support a system crash dump. System administrators now have the option to create a dedicated dump file instead by using the following software packages. This option became available as of:
- Windows 7 Service Pack 1 with hotfix KB 2716542 applied.
- Windows Server 2008 R2 Service Pack 1 with hotfix KB 2716542 applied.
A dedicated dump file is a page file that is not used for paging. Instead, it is "dedicated" to support a system crash dump file (memory.dmp) when a system crash occurs. Dedicated dump files can be put on any disk volume that can support a page file. We recommend that you use a dedicated dump file when you want a system crash dump file, but you do not want a page file.
For more information about dedicated dump files, click the following article numbers to go to the articles in the Microsoft Knowledge Base:
969028 How to generate a kernel or a complete memory dump file in Windows Server 2008 and Windows Server 2008 R2
950858 Dedicated dump files are unexpectedly truncated to 4 GB on a computer that is running Windows Server 2008 or Windows Vista and that has more than 4 GB of physical memory
System-managed page files
By default, page files are system-managed. This means that the page files increase and decrease based on many factors, such as how much physical memory is installed, the process of accommodating the system commit charge, and the process of accommodating a system crash dump.
For example, when the system commit charge is more than 90 percent of the system commit limit, the page file is increased to support it. This continues to occur until the page file reaches three times the size of physical memory or 4 GB, whichever is larger. This assumes that the logical disk that is hosting the page file is large enough to accommodate the growth.
Several performance counters are related to page files. This section describes the counters and what they measure.
\Memory\Page/sec and other hard page fault counters
The following performance counters measure hard page faults (which include, but are not limited to, page file reads):
- \Memory\Page Reads/sec
- \Memory\Page Inputs/sec
The following performance counters measure page file writes:
- \Memory\Page Writes/sec
- \Memory\Page Output/sec
Hard page faults are faults that must be resolved by retrieving the data from disk. Such data can include portions of DLLs, .exe files, memory-mapped files, and page files. These faults might be related to a page file or to a low-memory condition. Hard page faults are a standard function of the operating system. They occur when the following items are read:
- Parts of image files (.dll and .exe files) as they are used
- Memory-mapped files
- A page file
High values for these counters (excessive paging) indicate disk access of generally 4 KB per page fault on x86 and x64 versions of Windows and Windows Server. This disk access might be related to page file activity but may contribute to poor disk performance that can cause system-wide delays if the related disks are overwhelmed.
Therefore, we recommend that you monitor the disk performance of the logical disks that host a page file in correlation with these counters. Be aware that a system that has a sustained 100 hard page faults per second experiences 400 KB-per-second disk transfers. Most 7,200-RPM disk drives can handle about 5 MB per second at an IO size of 16 KB, or 800 KB per second at an IO size of 4 KB. No performance counter directly measures which logical disk the hard page faults are resolved for.
\Paging File(*)\% Usage
The \Paging File(*)\% usage performance counter measures the percentage of usage of each page file. 100-percent usage of a page file does not indicate a performance problem as long as the system commit limit is not reached by the system commit charge and if a significant amount of memory is not waiting to be written to a page file.
Note The size of the Modified Page List (\Memory\Modified Page List Bytes) is the total of modified data that is waiting to be written to disk.
If the Modified Page List (a list of physical memory pages that are the least frequently accessed) contains a lot of memory and if the usage value of all page files is greater than 90 percent, you can make more physical memory available for more frequently access pages by increasing or adding a page file.
Note Not all the memory on the modified page list is written out to disk. Typically, several hundred megabytes of memory remains resident on the modified list.
Multiple page files and disk considerations
If a system is configured to have more than one-page file, the page file that responds first is the one that is used. This means that page files that are on faster disks are used more frequently. Also, putting a page file on a “fast” or “slow” disk is important only if the page file is frequently accessed and if the disk that is hosting the page file is overwhelmed.
Be aware that actual page file usage depends greatly on the amount of modified memory that the system is managing. This means that files that already exist on disk (such as .txt, .doc, .dll, and .exe files) are not written to a page file. Only modified data that does not already exist on disk (for example, unsaved text in Notepad) is memory that could potentially be supported by a page file. After the unsaved data is saved to disk as a file, it is supported by the disk and not by a page file.
It's used by the Universal apps. See Windows 8 / Windows Server 2012: The New Swap File.
Windows Internals, 7th Edition:
To set up a perfmon, read the following articles:
Setting a local perfmon in a Windows client or Windows Server
Setting a remote perfmon in a Windows client or Windows Server
Setting a local perfmon in 64-bit Hyper-V 2012 R2 and/or 64-bit Windows Server 2012 R2 Hyper-V
To analyze a perfmon, read the following article: