Microsoft KB Archive/906952

= 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 =

Article ID: 906952

Article Last Modified on 10/11/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * 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:

Time:

User: N/A

Computer:

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:

Time:

User: NT AUTHORITY\SYSTEM

Computer:

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 \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  registry subkey are similar to the following:

% %\% % (from % %) in session

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

\\% %\% % (from % %) in session ,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.



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 &quot;Workaround&quot; 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:

http://support.microsoft.com/default.aspx?scid=fh;[LN;CNTACTMS]

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.

Prerequisites
To apply this hotfix, you must have Windows 2000 Service Pack 4 (SP4) installed on the computer.

Restart requirement
You must restart the computer after you apply this hotfix.

Hotfix replacement information
This 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  registry subkey. To do this, follow these steps: <ol> Click Start, click Run, type regedit, and then click OK.</li> Locate the following registry subkey:

HKEY_USERS\.default\printers

</li> Right-click the registry subkey that you located in step 2, point to New, click Key, type PrinterMaskKey, and then press ENTER.</li> Exit Registry Editor.</li></ol>

Service pack information
To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for 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 &quot;Workaround&quot; section before you apply this hotfix.

Prerequisites
No prerequisites are required.

Restart requirement
You must restart the computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace any other hotfixes.

File information
Windows Server 2003, 32-bit versions

Windows Server 2003, x64-based versions

Windows Server 2003, Itanium-based versions

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  registry subkey. To do this, follow these steps: <ol> Click Start, click Run, type regedit, and then click OK.</li> Locate the following registry subkey:

HKEY_USERS\.default\printers

</li> Right-click the registry subkey that you located in step 2, point to New, click Key, type PrinterMaskKey, and then press ENTER.</li> Exit Registry Editor.</li></ol>

<div class="workaround_section">

WORKAROUND
To work around this problem, follow these steps: <ol> Make sure that all users have logged off the server, and then remove the server from the production environment.</li> Restart the server.</li> 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: <ol style="list-style-type: lower-alpha;"> 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

</li> Restart the computer by using the parallel installation of Windows that you installed in step 3a.</li> 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.</li> Load the default.bak registry hive. To do this, follow these steps: <ol> Click Start, click Run, type regedit, and then click OK.</li> <li>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.</li> <li>Name the newly loaded registry hive. For example, name the new registry hive TEMP-DEFAULT.</li></ol> </li> <li>Locate and delete the following subkey:

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

</li> <li>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.</li></ol>

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows Server 2003 Service Pack 2.

<div class="moreinformation_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

Keywords: kbtshoot kbbug kbfix kbqfe kbpubtypekc kbhotfixserver kbwinserv2003sp2fix KB906952

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.