Microsoft KB Archive/247904

From BetaArchive Wiki
Knowledge Base


How to Configure the Paged Address Pool and System Page Table Entry Memory Areas

Article ID: 247904

Article Last Modified on 3/2/2007



APPLIES TO

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Datacenter Server



This article was previously published under Q247904

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry


SUMMARY

This article describes how to adjust the size of the Paged Address Pool and System Page Table Entry (SystemPTE) memory areas in Windows 2000-based computers running the Microsoft Terminal Server service.

MORE INFORMATION

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Windows 2000 can directly address up to 2^32 bytes or 4 gigabytes (GB) of memory address space, regardless of how much physical Random Access Memory (RAM) is installed. By default, 2 GB of this address space is allocated to each process, and 2 GB is allocated to the kernel. While separate 2 GB regions of address space are used for each process in the computer, most of the 2 GB kernel area is global and remains the same no matter which user-mode process is currently active.

The 2 GB of kernel area contains all system data structures and information. Therefore, the 2 GB kernel address space area can impose a limit on the number of system data structures and the amount of kernel information that can be stored on a computer, regardless of how much RAM is installed.

The two types of data that share a portion of this 2 GB address area are Paged Pool allocations, and kernel stack allocations. Paged Pool allocations are memory allocations made by kernel-mode components. Kernel stack allocations are stacks created in the kernel for each thread to use for making system calls. Paged pool allocations are made in the Paged Pool area, and kernel stack allocations are made in the System Page Table Entry (PTE) area.

While these different allocations share the same area, the partition between them is fixed at startup. If the operating system runs out of space in one of those areas, the other area cannot donate space to it, and programs may begin to encounter unexpected errors. Therefore, when you encounter a Windows 2000-based computer that is experiencing unexpected errors or an inability to accept new logins, and the computer does not have some other resource limitation such as Central Processing Unit (CPU) or disk bottlenecks, it is highly likely that the Paged Pool or System PTE areas are becoming low on disk space. Because, by default, the System PTE area is sized to be as large as possible on a computer with Terminal Services enabled, the limitation will usually be due to insufficient Paged Pool address space. Fortunately on some computers, the System PTE area can be configured to be smaller, which can alleviate these symptoms and allow more users access to the computer.

To determine if your computer has run out of one or more of these resources:

  1. Attach a kernel debugger to the computer.
  2. Use a text editor to add the /DEBUG parameter to the Boot.ini file.
  3. Restart the computer.

For additional information about using a kernel debugger, click the article number below to view the article in the Microsoft Knowledge Base:

151981 How to Set Up a Remote Debug Session Using a Null Modem Cable


When you believe the system has reached a limit:

  1. Break in to the debugger.
  2. Type !vm , and then press ENTER.
  3. If the debugger output shows any errors, type !reload, and then press ENTER, to ensure you have the correct symbols.

The following is a sample debug session. The data of interest is in bold type for clarity:

      • Virtual Memory Usage ***

Physical Memory: 1032075 ( 4128300 Kb)
Page File: \??\C:\pagefile.sys
Current: 4190208Kb
Minimum: 4190208Kb
Maximum: 4190208Kb
Available Pages: 599741 ( 2398964 Kb)
ResAvail Pages: 894259 ( 3577036 Kb)
Modified Pages: 757 ( 3028 Kb)
NonPagedPool Usage: 15084 ( 60336 Kb)
NonPagedPool Max: 71586 ( 286344 Kb)
PagedPool 0 Usage: 22953 ( 91812 Kb)
PagedPool 1 Usage: 4324 ( 17296 Kb)
PagedPool 2 Usage: 4315 ( 17260 Kb)
PagedPool 3 Usage: 4360 ( 17440 Kb)
PagedPool 4 Usage: 4366 ( 17464 Kb)
********** Excessive Paged Pool Usage *****
PagedPool Usage: 40318 ( 161272 Kb)
PagedPool Maximum: 40960 ( 163840 Kb)
Shared Commit: 30133 ( 120532 Kb)
Special Pool: 0 ( 0 Kb)
Free System PTEs: 47920 ( 191680 Kb)
Shared Process: 99141 ( 396564 Kb)
PagedPool Commit: 40318 ( 161272 Kb)
Driver Commit: 770 ( 3080 Kb)
Committed pages: 822746 ( 3290984 Kb)
Commit limit: 2037826 ( 8151304 Kb)
Total Private: 545122 ( 2180488 Kb)


The "********** Excessive Paged Pool Usage *****" entry in this output listing is indicative of a computer that is low on paged pool resources. This may be confirmed by noting that the PagedPool Usage entry is very close to the PagedPool Maximum entry.

In order to configure the partition between System PTE space and Paged Pool space on a computer with a clean Windows 2000 installation, the computer must be out of paged pool resources, and the computer must have a significant amount of Free System PTE space remaining. The amount of Free System PTE space should be 40,000K or greater. If the computer is out of Free System PTE space, you cannot use the following method to get more users logged in to Terminal Server.

To tune the computer for the optimal balance between paged pool space and system PTE space:

  1. Restart the computer, and then log in.
  2. Break into the debugger, type !vm, and then press ENTER.
  3. Write down the values of PagedPool Maximum, PagedPool Used, and Free System PTEs. The values to write down are in kilobytes, and are enclosed in parentheses.
  4. At the debug host computer, type g, and then press ENTER.
  5. At the target computer, log in 10 Terminal Server users, and keep them all logged in. Do not disturb the server in any way, other than as required by this procedure.
  6. For all 10 sessions, start all the programs you expect the users to be running at one time. This is going to be the representative sample of your users. The programs these sessions are running should be representative of what all the users on this system will be running at any point in time in your normal production environment. For best results, any remote users should perform a few actions considered normal for the programs they are running. For example, in a word processing program, the users would type, or in a line-of-business program, the users might enter a few orders.
  7. Break into the debugger, type !vm, and then press ENTER.
  8. Write down the values of PagedPool Used and Free System PTEs.
  9. Perform the following calculations:

    1. amount of paged pool per user=(amount of paged pool used final-amount of paged pool used initially)/10

      where amount of paged pool per user is the amount of paged pool per user, amount of paged pool used final is the amount of paged pool used final, and amount of paged pool used initially is the amount of paged pool used initially.
    2. amount of system PTEs per user=(amount of free system PTEs initial-amount of free system PTEs final)/10

      where amount of system PTEs per user is the amount of system PTEs per user, amount of free system PTEs initial is the amount of free system PTEs initial, and amount of free system PTEs final is the amount of free system PTEs final.
  10. To modify the registry:

    1. Determine the available virtual address space as well as the virtual space needed per user:

      AvailableVirtualSpace = PagedPoolMaximum + FreeSystemPTEsinitial - PagedPoolUsedinitial

      where AvailableVirtualSpace is the amount of available virtual space, PagedPoolMaximum is the amount of paged pool maximum, FreeSystemPTEsinitial is the amount of free system PTEs initially, and PagedPoolUsedinitial is the amount of paged pool used initially.
    2. Using the following formula, determine how much virtual space is required per user:

      VirtualSpacePerUser = PagedPoolPerUser + SystemPTEsPerUser

      where VirtualSpacePerUser is the amount of virtual space required per user, PagedPoolPerUser is the amount of paged pool per user, and SystemPTEsPerUser is the amount of system PTEs per user.
    3. Using the following formula, determine how many users this computer could theoretically support:

      MaxUsers = AvailableVirtualSpace / VirtualSpacePerUser

      where MaxUsers is the maximum number of users, AvailableVirtualSpace is the amount of available virtual space, and VirtualSpacePerUser is the amount of virtual space per user.
    4. Using the following formula, determine how much System PTE space is needed:

      PTErequired = SystemPTEsPerUser x MaxUsers

      where PTErequired is the amount of PTEs required, SystemPTEsPerUser is the number of PTEs per user, and MaxUsers is the maximum number of users.
    5. Using the following formulas, calculate the amount of excess PTEs and SystemPages:
      PTEexcess= FreeSystemPTEsinitial - PTErequired

      where PTEexcess is the amount of excess PTEs, FreeSystemPTEsinitial is the amount of free system PTEs initially, and PTErequired is the amount of PTEs required.
      WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

    6. From a command prompt, use the registry editor (Regedit32.exe) to modify the SystemPages value in HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management\SystemPages to the value computed from the following formula:

      SystemPages = 50,000 - (PTEexcess / 4) (Rounded to the nearest integer.)

      where SystemPages is the number of system pages, and PTEexcess is the amount of excess PTEs.

      If the computed value of SystemPages is below 7,000, set the value to 7,000. If the computed value is above 50,000, then your address space boundary is already configured for the maximum amount of users.
    7. Restart the computer, break into the debugger, type !vm, and then press ENTER.
    8. Verify that the Paged Pool Maximum has increased and the System PTE space has decreased.



Additional query words: /PAE PAE

Keywords: kbenv kbhowto KB247904