Article ID: 2021748 - Last Review: May 21, 2012 - Revision: 13.0

How to determine the appropriate page file size for 64-bit versions of Windows Server 2008 and or Windows 2008 R2

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
Expand all | Collapse all

Summary

 

 

The 64-bit versions of Microsoft Windows Server 2008 and Microsoft Windows Server 2008 R2 can support more RAM than the 32-bit versions of Windows Server. When lots of memory is added to a computer, a paging file may not be required. When you use the Memory-Pages/sec counter to measure paging file use, the value that is returned may not be accurate. To obtain an accurate measurement of paging file use, you must also use other performance counters. You can use System Monitor measurements to calculate the size of the paging file that your computer requires.

Windows Server 2008 and Windows Server 2008 R2 Domain Controllers are not supported without a configured pagefile. Because the algorithm the LSASS database cache depends on the "transition pages repurposed/second" perfmon counter, a pagefile is required to make sure that the database cache is capable to release memory if memory is requested by other services or applications.

 

  INTRODUCTION

When you set up a 64-bit version of Microsoft Microsoft Windows Server 2008 and Microsoft Windows Server 2008 R2, the operating system will create a page file that is  auto managed (Automatically manage paging file size for all drives) in your computer. However, as the amount of RAM in a computer increases, the need for a page file may decrease. The following guidelines and methods will help you determine the appropriate page file size for your system.

 Comparison of memory and CPU limits in the 32-bit and 64-bit versions of Windows

 When you set up a 64-bit version of Windows Server 2008 or  Windows Server 2008 R2, a page file is created that is depeding on how much RAM is installed and provided there is sufficient free space on the system hard disk:

The more RAM that you have available or is added to a computer,  it generally tends to decrease the size of the page file needed.  If you have enough RAM installed in your computer, you may not require a page file at all, unless one is required by a specific application.  This all depends on how much virtual memory is used by your system and/or applications installed.

 

System Memory Size (RAM)

Minimum Page File Size   

Maximum Page File Size

Windows XP and Windows Server 2003 <1GB  

1.5 x RAM   

3 x RAM

Windows XP and Windows Server 2003 >= 1GB

1 x RAM

3 x RAM

Table 1.  Default Page File Sizes for Windows XP and Windows Server 2003.

System Memory Size (RAM)

Minimum Page File Size   

Maximum Page File Size

<1GB  

Large enough to hold a kernel-memory crash dump and is RAM plus 300MB or 1GB, whichever is larger 

3 x RAM or 4GB, whichever is larger

>= 1GB

Large enough to hold a kernel-memory crash dump and is RAM plus 300MB or 1GB, whichever is larger

3 x RAM or 4GB, whichever is larger

Table 2.  Default Page File Sizes for Windows Vista, Windows Server 2008, Windows 7 and Windows Server 2008 R2.

Source: "Windows Internals" 5th edition Chapter 9:  Memory Management Page 781.

 The following chart illustrates the amount of RAM and the number of CPUs that can be installed on a computer depending on the operating system that is installed. RAM and CPU limits are much larger in 64-bit Windows Server 2008/Windows Server 2008 R2 operating systems than in 32-bit Windows Server 2008 operating systems.

 

General memory limits

32-bit

64-bit (x64)

Total virtual address space

4 gigabytes (GB)

16 terabytes (TB)

Virtual address space per 32-bit process

2 GB or 3 GB if the system is booted with the /3GB switch

2 GB or 4 GB if the application is compiled with the /LARGEADDRESSAWARE switch

Virtual address space per 64-bit process

Not applicable

8 terabytes

Paged pool

2 gigabytes (GB)

128 GB

Non-paged pool

2GB or 75% of physical memory, whichever is smaller

128 GB or 75% of physical memory, whichever is smaller

System cache

1 GB

1 terabyte (TB)

  Table 3.  Virtual memory address space and kernel address space.

 

Physical memory and CPU limits

32-bit

64-bit (x64)

Windows Vista, Business, Enterprise and Ultimate Editions

4 GB / 1-2 Socket for CPUs

128 GB / 1-2 Sockets for CPUs

Windows Web Server 2008

(4) GB / 1-4 Socket for CPUs

 

32 GB / 1-4 Sockets for CPUs

Windows Server 2008, Standard Edition

4 GB / 1-4 Socket for CPUs

32 GB / 1-4 Sockets for CPUs

Windows Server 2008, Enterprise Edition

64 GB / 1-8 Socket for CPUs

2 terabyte / 1-8 Sockets for CPUs

Windows Server 2008, Datacenter Edition

64 GB / 1-64 Socket for CPUs

2 terabyte / 1-64 Sockets for CPUs

Windows HPC Server 2008

N/A

128GB /1-4 Sockets for CPUs

Windows 7, Professional, Enterprise and Ultimate Editions

4 GB / 1-4 CPUs

192 GB / 1-4 Sockets for CPUs

Windows Server 2008 R2, Foundation Edition

N/A

8GB / 1 Socket for CPUs

 

Windows Web Server 2008 R2

N/A

32 GB / 1-4 Sockets for CPUs

Windows Server 2008 R2, Standard Edition

N/A

32GB / 1-4 Sockets for CPUs

Windows Server 2008 R2, Enterprise Edition

N/A

2 terabyte / 1-8 Sockets for CPUs

Windows Server 2008 R2, Datacenter Edition

N/A

2 terabyte / 1-64 Sockets for CPUs

Windows HPC Server 2008 R2

N/A

128GB /1-4 Sockets for CPUs

 Table 4.  RAM and CPU's.

 There is no specific recommendation for page file size. Your requirements will be based on the hardware and software that you use and the load that you put on the computer.

 To monitor page file usage and requirements, you could use various tools such as:

1. Process Explorer

or

2. System Monitor (Sysmon).

 

 How to calculate page file size

Use one or more of the following methods to help you calculate page file size.

 Method 1: Use the Microsoft SysInternals Process Explorer

Click on View, System Information... (CLTR+I)

Under "Commit Charge (K)
          Current ___________
          Limit __________
          Peak __________

          Peak/Limit ____ %
          Current/Limit ____%

Limit - Peak = How much page file that you need.

Warning:  You should let the system run thru at least a week, preferably a month to get a good "Commit Charge Peak (K)"

Note Virtual memory that accounts towards the commit limit:

  • private virtual memory (called private because it cannot be shared such as garbage collector heap, native heap and language allocators)

        and

  • pagefile-backed (can be shared which can be only seen using handle.exe)

        handle.exe -a -l -p ApplicationName.exe

 Note Not all virtual memory accounts towards the commit limit such as:

  • Reserved Virtual Memory

        or

  • File Mapping View (virtual memory that represents a file on the disk)

To monitor page file usage and requirements, run Sysmon, and gather a log during typical usage conditions. Focus on the following counters.

 

Counter threshold

Suggested value

Memory\\Available Bytes

No less than 64MB for 64-bit or no less than 4 MB for 32-bit

Memory\\Pages Input/sec

No more than 10 pages

Paging File\\% Usage

No more than 70 percent

Paging File\\% Usage Peak

No more than 70 percent

Process\\Page File Bytes Peak

Not applicable

 Note Page file use should be tracked periodically. When you increase the use or the load on the system, you generally increase the demand for virtual address space and page file space.

The Pages/sec counter

When you use System Monitor, the values that are returned by the Pages/sec counter for the Memory performance object may be more than you expect. These values may not be related to either paging file activity or cache activity. Instead, these values may be caused by an application that is sequentially reading a memory-mapped file.

 The Pages/sec counter counts the number of pages that are read from the disk or that are written to the disk to resolve memory references to pages. These pages were not in memory at the time of the reference. The Pages/sec value is the sum of the Pages Input/sec and Pages Output/sec counter values. The Pages/sec counter includes paging traffic on behalf of the system cache to access file data for applications.

 Pages/sec is the primary counter to watch if you are concerned about excessive memory pressure (thrashing) and the excessive paging that may result.

 However, the Pages/sec counter also accounts for other activity, such as the sequential reading of memory-mapped files that are either cached or not. Typically, the Pages/sec counter is counting other activity when you see the following:

 

A high value for the Memory: Pages/sec counter.

An average value, relative to the system being monitored, or a high value for the Memory: Available Bytes counter.

An average or small value for the Paging File: % Usage counter.

For a non-cached memory-mapped file, you also see average or low cache activity. (Low cache activity is also known as cache fault activity.)

 Therefore, a high value for the Memory: Pages/sec counter does not necessarily indicate memory pressure or a System Monitor reporting error. To gain an accurate reading of your system, you must also monitor other counters.

 How to calculate page file size

Use one or more of the following methods to help you calculate page file size.

 Method 2: Use performance logs to understand the paging activity on your computer

 

1.

Click Start , point to Administrative Tools , and then click Performance Monitor.

2.

Expand Data Collector Sets , right-click User Defined, click on New, click on the "Data Collector Set".

3.

In the Name box, type a name for the log, and then click OK .

4.

Select the radio button named Create manually (advanced), click on Next.

5.

Select the radio button named Create data logs:, and then check the box for Performance counter, click on Next.

6.

Under the "Which performance counters would you like to log?" Click Add...

7.

Under "Select counters from computer", leave <Local computer>.

8.

In the Performance object list, click Paging File and then select % Usage

9.

Under "Instances of selected object:" select the pagefile such as \\?\C:\pagefile.sys.  Click on Add>>

10.

In the Performance object list, click Memory and then click Available MBytes , and then click Add>>.

11.

Click Pages Input/sec , click Add>> , and then click OK .

12.

Under "Sample interval:" change it to the interval that you want (15 seconds is the default)

13.

Click Next twice

14.

Click Finish

 or using the command line:

 Click on Start
<<Start Search>>, enter "CMD.exe" w/o the quotation marks and then press Enter.

Logman.exe create counter Pagfile-Counter-Log -o "c:\perflogs\PageFile_Sizing.blg" -f bincirc -v mmddhhmm -max 250 -c "\Memory\*" "\Paging File(*)\*" "\Process(*)\*" -si 00:00:15

Note:  Please change the interval 00:00:15 (15 seconds) as needed.

Logman.exe start Pagefile-Counter-Log

Please stop the performance log after a week or whatever time period that you choose.

Logman.exe stop Pagefile-Counter-Log

 Use the log that you collect during typical computer use to understand the paging activity on your computer. Then, adjust the page file size accordingly.

 Method 3: Use the Page File Bytes Peak counter to calculate page file size

 

1.

Click Start , point to Administrative Tools , and then click Performance Monitor.

2.

Expand Data Collector Sets , right-click User Defined, click on New, click on the "Data Collector Set".

3.

In the Name box, type a name for the log, and then click OK .

4.

Select the radio button named Create manually (advanced), click on Next.

5.

Select the radio button named Create data logs:, and then check the box for Performance counter, click on Next.

6.

Under the "Which performance counters would you like to log?" Click Add...

7.

Under "Select counters from computer", leave <Local computer>.

8.

In the Performance object list, click Process, click Page File Bytes Peak

9.

Under "Instances of selected object:", select Total, click on Add>> , and then click OK .

10.

Under "Sample interval:" change it to the interval that you want (15 seconds is the default)

11.

Click Next twice

12.

Click Finish

13.

Let the counter run during typical use of your computer.

14.

Note the maximum value for the Page File Bytes Peak counter, and then multiply the value by 0.70. The sum of the equation is the size to set for your page file.

 or using the command line:

 Click on Start
<<Start Search>>, enter "CMD.exe" w/o the quotation marks and then press Enter.

Logman.exe create counter Pagfile-Counter-Log -o "c:\perflogs\PageFile_Sizing.blg" -f bincirc -v mmddhhmm -max 250 -c "\Memory\*" "\Paging File(*)\*" "\Process(*)\*" -si 00:00:15

Note:  Please change the interval 00:00:15 (15 seconds) as needed.

Logman.exe start Pagefile-Counter-Log

Please stop the performance log after a week or whatever time period that you choose.

Logman.exe stop Pagefile-Counter-Log

 

Method 4: Calculate the minimum and maximum page file size

To determine the approximate minimum page file that is required by your system, calculate the sum of peak private bytes that are used by each process on the system. Then, subtract the amount of memory on the system.

 To determine the approximate maximum page file space that is required for your system, calculate the sum of peak private bytes that are used by each process on the system. Then, add a margin of additional space. Do not subtract the amount of memory on the system. The size of the additional margin can be adjusted based on your confidence in the snapshot data that is used to estimate page file requirements.

 Note This estimate is accurate only if the snapshot of data that is used to make the calculations is accurate.

Page file input/output rates

To avoid overloading the system or other disks with page input/output (I/O) activity, use the following guidelines when you set up the page file on your computer:

 

If the page I/O (real disk I/O) rate is more than 10 pages per second, we recommend that you do not put the page file where the I/O activity occurs on the system disk. When the page I/O rate is 10 pages per second or more, we recommend that you dedicate a separate hard disk for paging.

If the page I/O rate to a particular disk that is used for paging is more than 60 disk I/O operations per second, use more than one dedicated page hard disk to obtain better performance. To do this, use multiple non-striped disks for paging, or use raid 0 striped disks for paging. Dedicate approximately one I/O hard disk to paging for every 60 pages per second of I/O activity.

 

For example, if a system is averaging 150 pages of I/O activity per second, use three individual hard disks, or a three-disk raid 0 stripe set for the page file.

 

Note These estimates are for hard disks that run at 7200 revolutions per minute (rpm). If you use a hard disk that runs faster, the I/O rate a disk can handle for page I/O will increase.

 

Note If peak performance is critical to your system, use peak I/O rates instead of average I/O rates for these calculations.

 Important Supportability Information:

 This article is specifically for computers that do not need kernel mode or full memory dump analysis. For business-critical servers where business processes require to server to capture physical memory dumps for analysis, the traditional model of the page file should be at least the size of physical ram plus 1 MB. This makes sure that the free disk space of the operating system partition is large enough to hold the OS, hotfixes, installed applications, installed services, a dump file, and the page file. On a server that has 32 GB of memory, drive C may have to be at least 86 GB to 90 GB. This is 32 GB for memory dump, 48 GB for the page file (1.5 times the physical memory), 4 GB for the operating system, and 2 to 4 GB for the applications, the installed services, the temp files, and so on. Remember that a driver or kernel mode service leak could consume all free physical RAM. Therefore, a x64 Windows Server 2008 or x64 Windows Server 2008 R2-based server in 64-bit mode with 32GB of RAM could have a 32 GB kernel memory dump file, where you would expect only a 1 to 2 GB dump file in 32-bit mode. This behavior occurs because of the greatly increased memory pools.

 For more information:

969028  How to generate a kernel or a complete memory dump file in Windows Server 2008

http://support.microsoft.com/?id=969028

 Question: How about not having a paging file?

 Answer: There are administrators that feel not having a page file results in better performance.

But having a page file means Windows can write pages on the modified list out to the page file, which makes that memory available for more useful purposes such as processes or file cache.

Thus, while there may be some workloads that perform better with no paging file, in general having one will mean more usable memory being available to the Operating system.

Note:  What is a modified list?  Modified lists represent pages that are not being accessed actively but have not been saved to disk.

 Question: Maximum paging file size

Answer: Maximum paging file size is limited as follows:

 

 x86

 x64

 IA-64

 

Maximum size of a paging file

 

4 gigabytes (non-PAE)
16 terabytes (PAE)

 

16 terabytes

 

32 terabytes

 

Maximum number of paging files

 

16

 

16

 

16

 

Total paging file size

 

64 gigabytes (non-PAE)
256 terabytes (PAE)

 

256 terabytes

 

512 terabytes

Question: Why is not a good idea to use Task Manager?

Click on Start, Taskmgr.exe

Click on the Performance tab

Under "System"

Commit (GB) ___/____

The first value is the Commited Bytes in gigabytes (GB)

Definition: "Committed Bytes is the amount of committed virtual memory, in bytes"

Simple term: RAM+Pagefile actually in use

The second value is the Commit Limit in gigabytes (GB)

Definition: "Commit Limit is the amount of virtual memory that can be committed without having to extend the paging file(s)"

Simple term: RAM+Pagefile

Answer: Because there is no Commited Bytes Peak, you cannot get a good reading of what your system looks like over time, let's say within 1 week or 2 weeks or a months period of utilization.

 

 

 

More Information

 

Windows® Internals, Fifth Edition
http://www.microsoft.com/learning/en/us/Book.aspx?ID=12069&locale=en-us

 

For product information about Windows Vista x64 Edition, visit the following Microsoft Web site:

http://www.microsoft.com/windows/windows-vista/compare-editions/64-bit.aspx

 

For product information about Windows Server 2008 x64-based versions, visit the following Microsoft Web site:

http://www.microsoft.com/servers/64bit/compare.mspx

 

For product information about Windows 7 x64 Edition, visit the following Microsoft Web site:

http://www.microsoft.com/windows/windows-7/features/64-bit-support.aspx

 

For product information about x64-based versions of Windows Server 2008 R2, visit the following Microsoft Web site:

http://www.microsoft.com/windowsserver2008/en/us/R2-scalability-reliability.aspx

 

889654 How to determine the appropriate page file size for 64-bit versions of Windows

http://support.microsoft.com/?id=889654  

 

Pushing the Limits of Windows: Virtual Memory
http://blogs.technet.com/markrussinovich/archive/2008/11/17/3155406.aspx

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use (http://go.microsoft.com/fwlink/?LinkId=151500) for other considerations.

APPLIES TO
  • Windows Vista Business 64-bit Edition
  • Windows Vista Business N 64-bit Edition
  • Windows Vista Enterprise 64-bit Edition
  • Windows Vista Ultimate 64-bit Edition
  • Windows Server 2008 Datacenter
  • Windows Server 2008 Enterprise
  • Windows Server 2008 Foundation
  • Windows Server 2008 Standard
  • Windows Server 2008 R2 Datacenter
  • Windows Server 2008 R2 Enterprise
  • Windows Server 2008 R2 Foundation
  • Windows Server 2008 R2 Standard
  • Windows HPC Server 2008
  • Windows HPC Server 2008 R2
Keywords: 
KB2021748