You may receive an “Out of Memory” error message because of the desktop heap limitation in Windows Vista

After you open many application windows in Windows Vista, 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 in Windows Vista. 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.


Important 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.
To resolve this problem, modify the desktop heap size. To do this, follow these steps:

1. Click Start, type regedit in the Start Search box, and then click regedit.exe in the Programs list.

Note If you are prompted for an administrator password or for confirmation, type your password, or click Continue.

2. Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems

3. Right-click the Windows entry, and then click Modify.
4. In the Value data section of the Edit String dialog box, locate the SharedSection entry, and then increase the second value for this entry.


The second value of the SharedSection registry entry is the size of the desktop heap. The heap is required for each desktop that is created in the interactive window station (WinSta0). The value is in kilobytes (KB).
We do not recommend that you set a value that is over 20480 KB for the second SharedSection value.

By default, the Windows registry entry contains the following data in an x86-based version of Windows Vista.


Note By default, the second value for the SharedSection entry is 3072 in an x86-based version of Windows Vista. By default, this second value for this entry is 20480 in an x64-based version of Windows Vista.

In Windows Vista and 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 do not recommend that you set a value that is over 20480.

Note The desktop heap size is not affected by the physical RAM on the computer. Therefore, you cannot improve the performance by adding physical RAM.

For more information about the desktop heap, visit the following Microsoft Web site: (

Windows Vista Enterprise 64-bit Edition
Windows Vista Home Basic 64-bit Edition
Windows Vista Home Premium 64-bit Edition
Windows Vista Ultimate 64-bit Edition
Windows Vista Business
Windows Vista Business 64-bit Edition
Windows Vista Enterprise
Windows Vista Home Basic
Windows Vista Home Premium
Windows Vista Ultimate


Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

To prove that you're not a bot, enter this code
Anti-Spam Image