Global Quota for Registry Data

Last reviewed: February 4, 1997
Article ID: Q94993
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.1, 3.5, 3.51, 4.0
    

SUMMARY

Window NT includes a "global quota" 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 "global quota" 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 (enough to support approximately 5000 users). The paged pool can be set to a maximum of 128 MB, so the RSL can be no larger than about 102 MB, supporting about 80,000 users (surpassing the realistic limitations of other parts of the system).


KBCategory: kbprg
KBSubcategory: BseRegistry
Additional reference words: 3.10



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 4, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.