Exele Calculations - no more libraries can be started due to heap size

How many libraries can be run?

When the Microsoft® Windows® operating system starts, it reserves various areas of memory for tracking its resources. One of these is the relatively unknown desktop heap. On Windows-based systems, the desktop heap stores information about the various processes running on the machine. Memory allocation of the heap is controlled by the number of open applications, windows, services and other resources. When a large number of processes are running, this heap may run out of memory.

How this memory is allocated has implications on the number of libraries that the Equation Server is able to start. When reading the details below, note that Equation Library executables are started by the Equation Server Service - they fall under the category of non-interactive processes .

Symptom of insufficient heap size

You have a large number of libraries running (>25). When you start the next library (LibraryX), it crashes. If you stop one of the running libraries, you are able to start LibraryX without any errors. 

Modifying heap size

The different values for the desktop heap are stored in the following Windows registry value: 
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows

To start the Windows registry editor, click Start > Run, and enter: regedt32. You can then expand the folders listed above in the left (navigation) pane of the Registry Editor to display the value of these settings in the view pane. The default data for this registry value will look something like the following (all on one line):
  1. %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On 337 SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
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.

Note: SharedSection values below may be different than the values you see in the registry. Different Windows OS versions have different defaults for SharedSection values. See User32.dll or Kernel32.dll does not initialize - Application Developer | Microsoft Learn for more information.

The first SharedSection value (1024) is the shared heap size common to all desktops. It is unlikely that you would ever need to change this value.

The second SharedSection value (3072) is the size of the desktop heap for each desktop that is associated with the "interactive" window station. It is unlikely that you would ever need to change this second SharedSection value.

The third SharedSection value (512) 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. Each running Equation Library is a process that is managed through the settings in this heap. Increasing this value will increase the maximum number of libraries that you can run simultaneously.
We suggest a setting of 1024 for the third SharedSection value.
Some customers use a value of 2048.

We suggest that you research and understand the impliciations of making any registry changes. You can read more about desktop heap and this registry setting at Microsoft Q184802.
You should reboot the computer to apply this registry change.


    • Related Articles

    • Does TopView run on 64-bit Windows?

      Yes! TopView 6.4 and later will run on Windows 64-bit operating systems.
    • TopView and the log4j security vulnerability CVE-2021-44228

      TopView does not use Log4J or any other Java components/libraries. It is not affected by the recent log4j vulnerabilities (e.g. CVE-2021-44228 (mitre.org)).
    • TopView Service won't start - Running a large number of services

      This answer is also included in the documentation shipped with TopView. How many TopView Services can I run? When Microsoft Windows starts, it reserves various areas of memory for tracking its resources. One of these is the relatively unknown desktop ...
    • Diagnosing and fixing Remote Viewer connection problems

      Remote Viewer connection issues are often due to one of the following: The Remote Viewer is not enabled in the Engine's configuration The Engine is stuck in Startup and not yet listening (v6.35 and earlier) The Engine is unable to listen on the ...
    • Counting points for TopView licenses

      TopView licenses are mainly based upon the number of points monitored by TopView. You can run multiple TopView configurations (The TopView Window, Alarm and Notification Engine) at the same time. The total points in use is the sum of the points ...