Event ID 2020 and event ID 1000 are logged and the registry size limit is exceeded on a computer that is running Terminal Services in Application Server mode and Windows Server 2003 or Windows 2000 (906952)



The information in this article applies to:

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

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

SYMPTOMS

Consider the following scenario:
  • Your computer is running Microsoft Windows Server 2003 or Microsoft Windows 2000.
  • The computer is running Terminal Services in Application Server mode.
  • Printer redirection is enabled.
  • The SetPrinter function is set to level 2.
In this scenario, you experience the following symptoms:
  • The registry size limit is exceeded. Additionally, the following event message is logged in the System log:Event Type: Error
    Event Source: Srv
    Event Category: None
    Event ID: 2020
    Date: Date
    Time: Time
    User: N/A
    Computer: Server Name
    Description: The server was unable to allocate from the system paged pool because the pool was empty.
  • Users may be unable to log on to the server that has Terminal Services enabled. In this case, the following event message is logged in the System log:Event Type: Error
    Event Source: Userenv
    Event Category: None
    Event ID: 1000
    Date: Date
    Time: Time
    User: NT AUTHORITY\SYSTEM
    Computer: ComputerName
    Description: RegLoadKey failed. Return value Insufficient system resources exist to complete the requested service for C:\Documents and Settings\ntuser.dat.
  • The default registry hive file that is located in the %SystemRoot%\System32\Config folder may increase. For example, the size may exceed more than 5 megabytes (MB).
  • Users who are connected through Terminal Services sessions may experience slow response or the client may appear to stop responding (hang) when it runs programs on the Terminal Server computer. Additionally, users may receive error messages that are related to system memory.

CAUSE

This problem occurs because temporary registry entries that contain printer information are not deleted when a user logs off. These undeleted registry entries accumulate until the default registry hive file exceeds the registry size limit.

On a terminal server, redirected printers are installed when a user logs on. The SetPrinter function stores detailed information about the printer in the buffer. When the user logs off, the printer is uninstalled and the corresponding registry values that contain printer information are deleted.

To support backward compatibility, the naming conventions for the registry values that store printer information for the currently logged on users are different when the SetPrinter function is set to level 2. For example, when a user manually configures printer settings, the registry values that are stored under the HKEY_CURRENT_USER\.Default\Printers\DevModes2 registry subkey are similar to the following:

%ClientName%\%PrinterName% (from %ClientName%) in session SessionName

The registry value that is created by using the earlier naming convention is similar to the following:

\\%ClientName%\%PrinterName% (from %ClientName%) in session SessionName,localspl

When the SetPrinter function is set to level 2, the registry entries that contain printer information appear to be automatically created. Because the removal process only looks for and deletes registry values that are manually created, these temporary registry entries are not deleted when a user logs off.

RESOLUTION

Windows 2000

Hotfix information

Important This hotfix prevents new values from being written to the registry, but this hotfix does not delete existing registry values. Therefore, you must complete the steps that are included in the "Workaround" section before you apply this hotfix. A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.PrerequisitesTo apply this hotfix, you must have Windows 2000 Service Pack 4 (SP4) installed on the computer.Restart requirementYou must restart the computer after you apply this hotfix. Hotfix replacement informationThis hotfix does not replace any other hotfixes.File information The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version           Size  File name
   --------------------------------------------------------
   09-Sep-2005  00:27  5.0.2195.7070  115,472  Winspool.drv
   25-Feb-2005  05:13  6.1.22.4       371,936  Updspapi.dll

Hotfix installation 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.

To enable this hotfix, you must create the PrinterMaskKey registry subkey. To do this, follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following registry subkey:

    HKEY_USERS\.default\printers

  3. Right-click the registry subkey that you located in step 2, point to New, click Key, type PrinterMaskKey, and then press ENTER.
  4. Exit Registry Editor.

Windows Server 2003

Hotfix information

Important This hotfix prevents new values from being written to the registry, but this hotfix does not delete existing registry values. Therefore, you must complete the steps that are included in the "Workaround" section before you apply this hotfix.A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Windows Server 2003 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.PrerequisitesNo prerequisites are required.Restart requirementYou must restart the computer after you apply this hotfix.Hotfix replacement informationThis hotfix does not replace any other hotfixes.File informationWindows Server 2003, 32-bit versions
File nameFile versionFile sizeDateTimePlatform
Winspool.drv5.2.3790.2740150,52805-Jul-200616:30Not Applicable
Windows Server 2003, x64-based versions
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Winspool.drv5.2.3790.2740252,92805-Jul-200617:03Not ApplicableSP1SP1QFE
Wwinspool.drv5.2.3790.2740150,52805-Jul-200617:03Not ApplicableSP1WOW
Windows Server 2003, Itanium-based versions
File nameFile versionFile sizeDateTimePlatformSP requirementService branch
Winspool.drv5.2.3790.2740410,11205-Jul-200617:02Not ApplicableSP1SP1QFE
Wwinspool.drv5.2.3790.2740150,52805-Jul-200617:02Not ApplicableSP1WOW

Hotfix installation 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.

To enable this hotfix, you must create the PrinterMaskKey registry subkey. To do this, follow these steps:
  1. Click Start, click Run, type regedit, and then click OK.
  2. Locate the following registry subkey:

    HKEY_USERS\.default\printers

  3. Right-click the registry subkey that you located in step 2, point to New, click Key, type PrinterMaskKey, and then press ENTER.
  4. Exit Registry Editor.

WORKAROUND

To work around this problem, follow these steps:
  1. Make sure that all users have logged off the server, and then remove the server from the production environment.
  2. Restart the server.
  3. If the memory leak has not exceeded the registry size limit, go to step 4. If the memory leak has exceeded the registry size limit, follow these steps:
    1. Install a parallel installation of Windows on the same partition as the installation that does not start. For more information about how to install a parallel installation of Windows, click the following article number to view the article in the Microsoft Knowledge Base:

      266465 How to perform a parallel installation of Windows 2000 or Windows Server 2003

    2. Restart the computer by using the parallel installation of Windows that you installed in step 3a.
    3. Rename the DEFAULT registry hive from the problem installation of Windows to DEFAULT.BAK.

      The path of the hive to rename is %Systemroot%\System32\Config\DEFAULT.
    4. Load the default.bak registry hive. To do this, follow these steps:
      1. Click Start, click Run, type regedit, and then click OK.
      2. Click HKEY_LOCAL_MACHINE, click Load Hive on the File menu, and then select the registry hive file that you backed up in step 3c.
      3. Name the newly loaded registry hive. For example, name the new registry hive TEMP-DEFAULT.
    5. Locate and delete the following subkey:

      HKEY_LOCAL_MACHINE\TEMP-DEFAULT\printers\Devmodes2

      Note TEMP-DEFAULT is the name of the registry hive that you loaded in step 3d.
    6. Re-create a blank Devmodes2subkey under HKEY_LOCAL_MACHINE\TEMP-DEFAULT\printers.
    7. Click the HKEY_LOCAL_MACHINE\TEMP-DEFAULT hive, and then click Save key in the File menu.
    8. Save the hive as DEFAULT in the %Systemroot%\System32\Config folder.
    9. In Registry Editor, click Unload Hive on the File menu.
    10. Restart the computer.
  4. If the memory leak has not exceeded the registry size limit, delete and then re-create the following registry subkey:

    HKEY_USERS\.default\printers\Devmodes2

  5. Monitor the size of the default registry hive file that is located in the %Systemroot%\system32\config folder. If the size of the default registry hive file exceeds the registry size limit, repeat step 3.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about how hotfix packages are named, click the following article number to view the article in the Microsoft Knowledge Base:

816915 New file naming schema for Microsoft Windows software update packages

For more information about the standard terminology that is used to describe Microsoft software updates, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


Modification Type:MinorLast Reviewed:7/26/2006
Keywords:kbHotfixServer kbtshoot kbBug kbfix kbQFE kbpubtypekc KB906952 kbAudITPRO