Miscellaneous
Miscellaneous other things.
Seconfig XP Other software Miscellaneous
Stats
  • Page visited 2446696 times
Page translation
Visitor locations
Other counters
  • ServiceUptime.com
  • on-line.lv
  Search Results  
Dāvis's tech blog - Strange memory/registry problems on Terminal Server
Recently I was asked to help troubleshoot a terminal server that sometimes couldn't load registry hives of users logging on. The server was running Windows 2000 Server and there were lots of users connecting to it.
When hive for Administrator account wasn't loaded these three errors were logged to event log:
RegLoadKey failed. Return value Insufficient system resources exist to complete the requested service. for C:\Documents and Settings\Administrator\ntuser.dat.
Windows cannot load your profile. Please increase the registry size and restart the computer.
Windows cannot load the user's profile but has logged you on with the default profile for the system.
DETAIL - Insufficient system resources exist to complete the requested service.
Also some virtual memory related errors were logged. Partially working solution (increasing registry size limit using System Properties control panel applet and increasing PagedPoolSize registry value) was found in some forum before I started my research.
At first I looked at pool usage (Kernel Memory in Performance tab of Task Manager) and value for paged pool was pretty big (over 150 MB). Next I enabled pool tagging and used Poolmon.exe to see what consumes most of paged pool. Name of the tag that used about 128 MB of paged pool was CM (referred as Configuration Manager (registry) in pooltag.txt), so it probably was actually related to registry. Examining size of main registry hive files (located at %SystemRoot%\system32\config) revealed that hive named default (this hive stores HKEY_USERS\.DEFAULT registry key) was about 100 MB in size, so I tried to use NTREGOPT to compact that hive.
Hive was compacted to about 85 MB that is far beyond its size on average systems. While examining contents of that hive (exported as usual .reg file) I noticed that most of .reg file is consumed by HKEY_USERS\.DEFAULT\Printers\DevModes2 key. This key was trashed by lots of printers connected via terminal services clients. I added a Scheduled Task that invokes regedit /s cleanprinters.reg every night (when no users should be connected) and created cleanprinters.reg with the following contents:
REGEDIT4

[-HKEY_USERS\.DEFAULT\Printers\DevModes2]
[HKEY_USERS\.DEFAULT\Printers\DevModes2]
After running cleanup task the first time and once more compacting registry with NTREGOPT hive named default and used paged pool sizes decreased almost to normal.

P.S. After all troubleshooting I found that this problem is also described in MS KB906952, but anyway I like my own solution.
P.S.2 There were also trashed some other (printer dependant) registry keys (under HKEY_USERS\.DEFAULT\Software and per-user HKEY_USERS\SID-of-user\Software) increasing registry size for about 14 MB for default user and 7 MB for each regular user.
Posted on 2007.08.25. 20:30

Anonymous at 2008.10.21. 18:34
David, hi.

This piece about the DevModes2 is just magic! I seach for a long while trying to figure it out why our TS was refusing to log in users. Thank you very much for sharing.

Anonymous at 2009.03.20. 17:34
You're a genius. would you mind posting all your Terminal Server printer cleanup text from your reg files?

Davis at 2009.04.05. 23:22
If I remember correctly, entire cleanprinters.reg file on that particular server was something like this:
REGEDIT4

[-HKEY_USERS\.DEFAULT\Printers\DevModes2]
[HKEY_USERS\.DEFAULT\Printers\DevModes2]
[-HKEY_USERS\.DEFAULT\Software\Hewlett-Packard]
[-HKEY_USERS\.DEFAULT\Software\Lexmark]


And .reg file imported at each users logon on that server was something like this:
REGEDIT4

[-HKEY_CURRENT_USER\Software\Hewlett-Packard]
[-HKEY_CURRENT_USER\Software\Lexmark]


Paul Churchill at 2009.12.21. 18:18
I have turned off mapping client printers in terminal service sessions, removed the contents of HKEY_USERS\.DEFAULT\Printers\DevModes2, and applied the KB906952 Hotfix - But am still getting VBRuntime errors saying it can't connect to old client printers that were mapped in a terminal service session. After doing some searching - Found old printer info in HKEY_CURRENT_USER\Printers\ - in DevModePerUser, DevModes2, and Settings. Should these be cleared out too?

Post a comment
Share |
© 2006-2012