You may receive an error (Out of Memory) because of the desktop heap limitation
This article helps fix an error (Out of Memory) that occurs when you open many application windows in Windows.
Original product version: Windows 7 Service Pack 1, Windows Server 2012 R2
Original KB number: 947246
After you open many application windows in Windows, you may be unable to open any additional windows. Sometimes, a window may open. However, it will not contain the expected components. Additionally, you may receive an error message that resembles the following:
Out of Memory
This problem occurs because of the desktop heap limitation. If you close some windows, and then you try to open other windows, these windows may open. However, this method does not affect the desktop heap limitation.
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, 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. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
To resolve this problem, modify the desktop heap size. To do this, follow these steps:
Click Start, type regedit in the Start Search box, and then click regedit.exe in the Programs list.
If you are prompted for an administrator password or for confirmation, type your password, or click Continue.
Locate and then click the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystemsregistry subkey.
Right-click the Windows entry, and then click Modify.
In the Value data section of the Edit String dialog box, locate the
SharedSectionentry, and then increase the second value and the third value for this entry.
- The second value of the
SharedSectionregistry entry is the size of the desktop heap for each desktop that is associated with an interactive window station. The heap is required for each desktop that is created in the interactive window station (WinSta0). The value is in kilobytes (KB).
- The third
SharedSectionvalue is the size of the desktop heap for each desktop that is associated with a non-interactive window station. The value is in kilobytes (KB).
- We don't recommend that you set a value that is over 20480 KB for the second
- The second value of the
By default, the Windows registry entry contains the following data in an x86-based version of Windows 7 Service Pack 1.
Windows 7 Service Pack 1 (64 bit) / Windows Server 2008 R2, 2012 R2 (64 bit)
In later operating systems, memory allocations are dynamic. Therefore, there is no limitation for memory allocation. However, if you allocate too much memory to the desktop heap, negative performance may occur. This is the reason why we don't recommend that you set a value that is over 20480.
The desktop heap size is not affected by the physical RAM on the computer. Therefore, you cannot improve the performance by adding physical RAM.
Did this fix the problem
Check whether the problem is fixed. If the problem is fixed, you are finished with this section. If the problem is not fixed, you can contact support.