Microsoft KB Archive/94993

{|
 * width="100%"|

INFO: Global Quota for Registry Data

 * }

Q94993

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), used with:
 * the operating system: Microsoft Windows NT, versions 3.1, 3.5, 3.51, 4.0
 * the operating system: Microsoft Windows 2000

-

SUMMARY
Window NT includes a &quot;global quota&quot; on the amount of memory that may be allocated in the registry. This prevents a broken or malicious application from effectively crashing the system by filling paged pool with registry data; however, it does NOT prevent such an application from using up all available registry space. Similar to the file systems, the registry does not support per process/user quotas.

MORE INFORMATION
The total amount of memory that may be consumed by registry data (the hives) is limited by the registry size limit (RSL). The RSL works as a &quot;global quota&quot; for registry space, both in the paged pool and on disk.

By default, the RSL is 25 percent of the size of the paged pool (the paged pool is the memory that may be swapped to disk; all user memory is part of the paged pool). Changing the size of the paged pool also affects the size of the RSL. See

  HKEY_LOCAL_MACHINE\System\ CurrentControlSet\ Control\ SessionManager\ MemoryManagement\ PagedPoolSize in the registry.

The RSL may also be manually set. The value in bytes may be specified by setting the value entry for the key

  HKEY_LOCAL_MACHINE\System\ CurrentControlSet\ Control\ RegistrySizeLimit. This key must have a type of REG_DWORD and a data length of 4 bytes, or it will be ignored.

If the value entry RegistrySizeLimit is less than 4 megabytes (MB), it will be forced up to 4 MB. If it is greater than about 80 percent of the size of the paged pool, it will be set down to 80 percent of the size of the paged pool. (It is assumed that paged pool is always larger than 5 MB.)

The system must be rebooted for changes in the RSL to take effect.

To ensure that the user can always at least boot and edit the registry if they somehow set the RSL wrong, the quota is not enforced until after the first successful loading of a hive (that is, loading of a user profile.)

Note that the RSL sets a maximum, not an allocation (unlike some other such limits in the system). Setting a large RSL does NOT cause the system to set aside that much space unless it is actually needed by the registry. It also does NOT guarantee that that much space will be available for use in the registry.

Setting the value entry RegistrySizeLimit to 0xffffffff effectively sets RSL to be as large as paged pool allows (80 percent of paged pool size).

In the initial release of Windows NT, the paged pool defaults to 32 MB, so the default RSL is 8 MB. The paged pool can be set to a maximum of 128 MB, so the RSL can be no larger than about 102 MB.

In Windows NT version 4.0, and Windows NT 4.0, Terminal Server Edition, the maximum Paged Pool size is 192 MB, so RSL can be a maximum of 153.6 MB.

In Windows 2000, the maximum paged pool is approximately 300-470 MB, when NOT using the /3GB switch. This would make RSL >296 MB. If the /3GB switch is used, these values remain unchanged from Windows NT 4.0. For additional information about this, click the article number below to view the article in the Microsoft Knowledge Base:

"Q126402 PagedPoolSize and NonPagedPoolSize Values in Windows NT"