Recipe9.11.Setting the Maximum Registry Size


Recipe 9.11. Setting the Maximum Registry Size

This recipe applies only to Windows 2000. On a Windows Server 2003 system, the maximum registry size is constrained only by the amount of physical memory installed.


Problem

You want to set the maximum size to which the registry files can grow.

Solution

For the change to take effect, you must restart the system after changing the size.

Using a graphical user interface

  1. Open the System applet in the Control Panel.

  2. Click the Advanced Tab.

  3. Click the Performance Options button.

  4. Click the Change button.

  5. Modify the maximum registry size setting at the bottom of the dialog box.

  6. Click OK until all of the windows are closed.

Using a command-line interface

To set the maximum registry size, run the following command:

> reg add \\<ServerName>\HKLM\System\CurrentControlSet\Control /v RegistrySizeLimit  /t REG_DWORD /d <SizeInBytes>

For example:

> reg add \\fs01\HKLM\System\CurrentControlSet\Control /v RegistrySizeLimit /t  REG_DWORD /d 104857600

To find the current size of the registry in bytes, run the following command:

> dureg -a

You can find the dureg utility in the Windows 2000 Resource Kit. For some reason it isn't part of the Windows Server 2003 Resource Kit.


Using VBScript
' This code sets the maximum registry size on a Windows 2000 server. ' ------ SCRIPT CONFIGURATION ------ intValue     = <SizeInBytes>   ' e.g., 104857600 (size of the registry in bytes) strComputer  = "<ServerName>"  ' e.g., server01 (use "." for local server) ' ------ END CONFIGURATION --------- const HKLM   = &H80000002 strKeyPath   = "System\CurrentControlSet\Control" strValueName = "RegistrySizeLimit" set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv") intRC = objReg.SetDwordValue(HKLM, strKeyPath, strValueName, intValue) if intRC <> 0 then    WScript.Echo "Error setting value: " & intRC else    WScript.Echo "Successfully set value for " & strValueName end if

Discussion

In Windows 2000, the contents of the registry are stored in paged pool, which is an area of physical memory that stores operating system data. By default, paged pool consumes 32 MB of memory, and unused paged pool is written to disk. The default size limit of the registry is 25% of paged pool, or 8 MB. You can configure a higher or lower size limit as I described in the Solution section. This may be needed if you see a message such as this after logging in:

Your maximum registry size is too small. To ensure that Windows runs properly, increase your registry size.

The registry doesn't automatically consume all of the space that is allocated; it uses only what it needs. The absolute minimum you can configure for the registry is 4 MB and the maximum is 80% of paged pool. The amount of memory allocated for paged pool can be configured by setting the PagedPoolLimit value under HKLM\System\CurrentControlSet\Control\SessionManager\MemoryManagement.

See Also

MS KB 124594 (Understanding and Configuring Registry Size Limit [RSL])



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net