Recipe 9.11. Setting the Maximum Registry Size
ProblemYou want to set the maximum size to which the registry files can grow. SolutionFor the change to take effect, you must restart the system after changing the size. Using a graphical user interface
Using a command-line interfaceTo 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
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 DiscussionIn 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:
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 AlsoMS KB 124594 (Understanding and Configuring Registry Size Limit [RSL]) |