How to Increase Windows NT System and Desktop Heap Sizes

Last reviewed: September 29, 1995
Article ID: Q125752
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT version 3.5
    

SUMMARY

Sometimes, it may be necessary to increase the amount of memory that Windows NT will make available for the system and desktop heaps. This can be accomplished by editing an entry in the registration database. System heap items are things like desktops and one-time-allocated items like system metrics. The items that come out of the desktop heap are items such as windows, menus, hook structures, queues, and some thread information.

MORE INFORMATION

The entry to be edited is under:

HKEY_LOCAL_MACHINE\

   System\
   CurrentControlSet\
   Control\
   Session Manager\
   SubSystems\
   Windows

Under this entry, you will find a string similar to the following (the slash (/) is a line continuation charater):

%SystemRoot%\system32\csrss.exe /

   ObjectDirectory=\Windows /
   SharedSection=1024,512 /
   Windows=On /
   SubSystemType=Windows /
   ServerDll=basesrv,1 /
   ServerDll=winsrv:GdiServerDllInitialization,4 /
   ServerDll=winsrv:UserServerDllInitialization,3 /
   ServerDll=winsrv:ConServerDllInitialization,2 /
   ProfileControl=Off /
   MaxRequestThreads=16

By changing the SharedSection values, you can affect the heap sizes. The first number (1024 as shown above) is the maximum size of the system wide heap in kilobytes. The second number (512 as shown above) is the maximum size of the per desktop heap in kilobytes. A desktop value of 512K can support approximately 2,500 windows.

The memory you allocate needs to be backed up by paging space. It should not have much effect on performance if you create the same number of items with different heap sizes. The main effect is overhead in heap management and initialization.


Additional reference words: 3.50
KBCategory: kbui
KBSubcategory: UsrWndw


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: September 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.