How to overcome the 4,095 MB paging file size limit in Windows (237740)



The information in this article applies to:

  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows XP Professional x64 Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition
  • Microsoft Windows 2000 Datacenter Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q237740
Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

SUMMARY

When you set the paging file size in Windows, the documentation states that the largest paging file that you can select is 4,095 megabytes (MB). This limit is imposed by the page mapping that we use on x86 processors. These processors cannot handle more pages per page file. This is the limit set per volume; you can actually create paging files this large on one or more drives if you need a larger paging file. If extra drives or volumes are not available, you can create multiple paging files on a single drive by placing them in separate folders.

However, you can create a single page file that is more than 4,095 MB on a Microsoft Windows Server 2003 Service Pack 1 (SP1)-based computer.

Note To get a complete memory dump from computers that have 4 GB RAM or more, it is still necessary to use the /MAXMEM switch in the Boot.ini file. One of the page files on the system partition must still be 1 MB larger than the amount of RAM installed in the computer to successfully create a memory dump.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

108393 The /maxmem switch in the Windows Boot.ini file

MORE INFORMATION

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.
Note that reading or writing a paging file of this size can be costly in terms of performance. If you find that you need a paging file of this size, it may be better to add more RAM to the computer. The current algorithm Windows uses to set the default paging file size is:
  • If total physical RAM is less than 2 gigabytes (GB), the paging file is set to 1.5 times the amount of RAM or 2 GB, whichever is smaller.
  • If total physical RAM is equal to or more than 2 GB, the default size is set to 2 GB.
To create multiple paging files on one volume to overcome the 4,095-MB limit:
  1. On the drive or volume you want to hold the paging files, create folders for the number of paging files you want to create on the volume. For example, C:\Pagefile1, C:\Pagefile2, and C:\Pagefile3.
  2. Click Start, Click Run, type regedit in the Open box, and then click OK.
  3. In the left pane, locate and click the following registry subkey:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SessionManager\MemoryManagement

  4. Find the Pagingfiles value, and then double-click it to open it.
  5. Remove any existing values, and add the following values:

    c:\pagefile1\pagefile.sys 3000 4000
    c:\pagefile2\pagefile.sys 3000 4000
    c:\pagefile3\Pagefile.sys 3000 4000

  6. Click OK, and then quit Registry Editor.
  7. Restart the computer to cause the changes to take effect.
  8. Access the virtual memory settings to check the properties of the paging file. To do this, follow these steps.

    Access the virtual memory settings on a Windows 2000-based computer
    1. On the desktop, right-click My Computer, and then click Properties.
    2. Click the Advanced tab.
    3. Click Performance Options.
    4. Click Change.
    Access the virtual memory settings on a Windows XP-based or a Windows Server 2003-based computer
    1. On the desktop, right-click My Computer, and then click Properties.
    2. Click the Advanced tab.
    3. Under Performance, click Settings.
    4. Click the Advanced tab, and then click Change.
In this example, the initial size of the paging files is set to 3000. You could save disk space by setting the initial size of the extra paging files to 0 so that the space is used only if it is needed. The initial size of the paging file is initialized to the minimum size when the computer starts. If the initial size is 3000, that space is reserved on the disk regardless of whether it is being used.

Note To get a complete memory dump from computers that have 4 GB RAM or more, it is still necessary to use the /maxmem switch in the Boot.ini. One of the page files on the system partition must still be 1 MB larger than the amount of RAM installed in the computer to successfully create a memory dump.

Modification Type:MajorLast Reviewed:7/14/2006
Keywords:kbDiskMemory kbhowto KB237740 kbAudITPRO