Skip to main content

Tuning the Windows Heap Setting for High Performance Systems

Depending on the type of workload your Agents generate on your server, it may be advantageous for you to tune the windows heap setting so that you can run more concurrent processes on your windows server.  Symptoms of running up against windows default system configuration limits are "Out of Memory" errors or errors that say "Error creating window handle". An example of a specific error message is "System.ComponentModel.Win32Exception (0x80004005): An attempt was made to reference a token that does not exist" which can be caused by a failure to create a new Windows handle.

When you run a large number of Windows-based programs, these error messages appear when you attempt to start new programs or try to use programs that are already running, even though you still have plenty of physical and pagefile memory available.

Make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. See this link for instructions on how to back up and restore the registry.

To increase the size of the desktop heap:-

  1. Run Registry Editor (Regedt32.exe).

  2. From the HKEY_LOCAL_MACHINE subtree, go to the following key:
    \System\CurrentControlSet\Control\Session Manager\SubSystems

  3. Select the Windows value.

  4. From the Edit menu, choose String.

  5. Increase the SharedSection parameter.
    For Windows NT:

    SharedSection specifies the system and desktop heaps using the
    following format:

    SharedSection=xxxx,yyyy

    The SharedSection key is a long string when viewed using Registry Editor.
    By default the value for this key is as follows:-

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:GdiServerDllInitialization,4 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

CHANGE IT TO

( %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,2048 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16 )

If your system has significant memory resources that are going unused, and you are seeing errors that say "Error creating window handle", you may want to increase heap  settings further:

( %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,4096 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16 )

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.