Managing number of Operable Windows in a session

Desktop Heap is a portion of address space that will control the allocations of memory for "GUI windows" on the screen. Desktop Heap also plays a part of how many services start up (when started with a specified user account).

The limitation of how many Windows can operate on your screen, is controlled from the Interactive Window Station which is derived from the Desktop Heap. Only the Logical Display Surface and Storage for Windows, along with Menu’s and application hooks are stored in this area of the Interactive Window Station (not the actual application).  When we’re talking about services, this is controlled by the Non-interactive Window Station.

The desktop Heap settings are stored in below key:

C:>reg query "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerSubSystems" /v Windows

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerSubSystems
    Windows    REG_EXPAND_SZ    %SystemRoot%system32csrss.exe ObjectDirectory=Windows SharedSection=1024,20480,768 Windows=On SubSyste
pe=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxs
,4 ProfileControl=Off MaxRequestThreads=16

C:>

Note: For any changes to this key to take place systems has to be restarted.

The numeric values following SharedSection= control how desktop heap is allocated. These "SharedSection" values are specified in kilobytes. There are separate settings for desktops associated with interactive and noninteractive window stations.

The first SharedSection value (1024) is the shared heap size common to all desktops. This includes the global handle table, which holds handles to windows, menus, icons, cursors, and so forth, and shared system settings. It is unlikely that you would ever need to change this value.

The second SharedSection value (20480) is the size of the desktop heap for each desktop that is associated with the "interactive" window station WinSta0. User objects like hooks, menus, strings, and windows consume memory in this desktop heap. It is unlikely that you would ever need to change this second SharedSection value.

The third SharedSection value (768) is the size of the desktop heap for each desktop that is associated with a "noninteractive" window station. If this value is not present, the size of the desktop heap for noninteractive window stations will be same as the size specified for interactive window stations (the second SharedSection value). This section of the heap is used to keep track of the processes that are running without graphical user interfaces.

Here is a graphical representation of heap allocation by Windows.

0 thoughts on “Managing number of Operable Windows in a session

Leave a Reply

Your email address will not be published. Required fields are marked *