sodcalculator

10 Tech How-To

Fix Not Enough Memory Resources Windows 10

Guide 10-24023 · Updated · Step by step

If you see “Not enough memory resources are available to process this command” in Windows 10, the fix is usually to increase the size of the desktop heap, a per-session memory pool that Windows allocates for GUI processes. You can do this by editing the Session Manager\Memory Management registry key, or by closing memory-hogging programs and restarting Explorer. Below is a complete guide to the causes, the exact registry fix, and other practical solutions.

What Causes This Error

This error message appears when a program or Windows itself tries to allocate memory from the desktop heap and fails. The desktop heap is a small, fixed-size memory region that each interactive window station and desktop uses to store window structures, menus, hooks, and other GUI objects. It is separate from the main virtual memory pool, and it is surprisingly small—by default, Windows 10 gives each non-interactive desktop about 512 KB and each interactive desktop about 20 MB. When that space is exhausted, any attempt to create a new window, menu, or drawing surface triggers the “not enough memory resources” error, even if your system has plenty of free RAM.

Common triggers include:

  • Running many GUI-heavy applications simultaneously (browsers with many tabs, Office, design tools, virtual machines).
  • A single application that leaks GDI objects (fonts, brushes, bitmaps) over time.
  • Windows Explorer (explorer.exe) accumulating hundreds of windows or menu items.
  • Multiple users logged on via Remote Desktop or Fast User Switching, each consuming desktop heap.
  • Malware or a buggy driver that floods the system with window messages.

The error often appears when you try to open a new window, right-click a file, or start a program, and it may be accompanied by other odd behavior like missing taskbar buttons or blank screens.

How the Desktop Heap Works

To understand the fix, you need to know a little about Windows memory architecture. Each interactive session (the one you see on the physical monitor, plus any Remote Desktop sessions) has a window station named WinSta0. Inside that window station are one or more desktops (usually Default, Screen-saver, and Winlogon). Every desktop has its own heap with a fixed maximum size.

Windows allocates this heap from the system paged pool, which itself is limited by the kernel and by the SessionViewSize and SessionPoolSize registry values. The desktop heap size is controlled by two values in the registry:

  • SharedSection under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management – the first number is the desktop heap size for non-interactive desktops (in KB), the second is for the interactive desktop, and the third (optional) is for the interactive desktop on Windows 10 (also in KB).
  • HeapSize under HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems – this is the size of the Windows subsystem heap, which also affects GUI resource availability.

When a process creates a window, it consumes a small amount of desktop heap. When it closes the window, that memory is freed. But if a process crashes or leaks, the heap can become fragmented and exhausted. Because the heap is per-desktop, even a single process with thousands of windows can exhaust it.

The Registry Fix (Step-by-Step)

The most reliable solution is to increase the desktop heap size. This requires editing the registry, so back up your registry first (File > Export in regedit). Then follow these steps:

  1. Press Win + R, type regedit, and press Enter. If prompted by UAC, click Yes.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management.
  3. Double-click SharedSection (if it doesn’t exist, create it as a REG_MULTI_SZ value).
  4. You will see three numbers separated by commas, like 3072,20480,768. The first is for non-interactive desktops, the second for the interactive desktop, and the third for the interactive desktop on Windows 10 (if present).
  5. Increase the second number (interactive desktop) from 20480 (20 MB) to 40960 (40 MB) or even 51200 (50 MB). Do not exceed 64 MB (65536) because that can cause other problems.
  6. If the third number exists, increase it proportionally (e.g., from 768 to 1536). If it doesn’t exist, you can add it as a third number.
  7. Click OK, then navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems.
  8. Double-click Windows (a REG_EXPAND_SZ value). You will see a long string that includes %SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,768 .... Change the second number after SharedSection= to the same value you used above (e.g., 40960).
  9. Click OK, close regedit, and restart your computer for the change to take effect.

If the error persists after a restart, try increasing the HeapSize value (also in the SubSystems key) from its default (usually 0x400000 or 4 MB) to 0x800000 (8 MB). This is less commonly needed, but it can help with severe GDI exhaustion.

Other Practical Fixes to Try First

Before editing the registry, try these simpler steps, as they may resolve the issue without any permanent changes:

  • Restart Windows Explorer: Open Task Manager (Ctrl+Shift+Esc), find “Windows Explorer”, right-click it, and choose “Restart”. This clears the desktop heap for Explorer and often fixes the error immediately.
  • Close memory-hungry programs: Browsers with dozens of tabs, Adobe Creative Suite, virtual machines, and other large apps consume GDI objects. Close them one by one and see if the error goes away.
  • Log off and log back on: This resets the entire session, including all desktop heaps.
  • Check for GDI leaks: Open Task Manager, go to the “Details” tab, add the “GDI objects” column (right-click the column header and select “Select columns”). If any process has more than 10,000 GDI objects, that process is likely leaking. Update or restart that program.
  • Run a malware scan: Malware can flood the system with hidden windows and exhaust the heap. Use Windows Defender or a reputable third-party scanner.
  • Update your graphics driver: A buggy display driver can cause GDI object leaks. Visit your GPU manufacturer’s website for the latest driver.

Common Mistakes and Misconceptions

Many users assume this error means they need more RAM or a bigger page file. That is usually not the case. The desktop heap is a fixed kernel pool, not the same as the user-mode memory that Task Manager shows. Adding RAM or increasing the page file will not help if the desktop heap is exhausted.

Another misconception is that the error is caused by a specific program’s memory usage. While a program can trigger it, the root cause is often the system-wide desktop heap limit, which is why the registry fix is the definitive solution.

One common mistake when editing the registry is to change the first number in SharedSection (the non-interactive desktop size) instead of the second. The first number affects services and non-interactive processes, not your main desktop. If you increase only the first number, you won’t see any improvement for the error you’re experiencing.

Also, be careful not to set the interactive desktop heap too high. Values above 64 MB can cause instability, and Windows may ignore values above a certain threshold. Stick to 40–50 MB as a safe maximum.

When to Use the Registry Fix vs. Reboot

A simple reboot will clear the desktop heap and usually fixes the error temporarily. If the error only happens occasionally after you’ve been using your PC for a long time, a reboot may be all you need. However, if the error occurs frequently or soon after startup, you should apply the registry fix to permanently increase the heap size.

There is also a middle ground: you can increase the desktop heap dynamically without a reboot by using the CDB (Console Debugger) tool, but that is complex and not recommended for most users. The registry edit is the standard, supported method.

Frequently Asked Questions

Does this error mean my RAM is faulty?

No. The error is about a specific kernel memory pool, not physical RAM. Faulty RAM usually causes blue screens, random crashes, or file corruption, not this specific message. You can still test your RAM with Windows Memory Diagnostic if you suspect hardware issues, but it is unlikely to be the cause.

Can I fix this without editing the registry?

Yes, temporarily. Restarting Explorer, logging off, or rebooting will clear the desktop heap and fix the error for a while. But if the error keeps coming back, the registry fix is the only permanent solution. You can also try reducing the number of programs that run at startup (Task Manager > Startup) to lower the initial heap usage.

Is it safe to increase the desktop heap to 64 MB?

Microsoft’s documentation suggests a maximum of 64 MB for the interactive desktop heap. Going above that can cause system instability, and Windows may ignore values above a certain threshold. Stick to 40–50 MB, which is usually sufficient for even heavy GUI use.

Why does the error happen more often with Remote Desktop?

Each Remote Desktop session has its own interactive desktop heap. If you have multiple users connected, each session consumes its own heap, and the system-wide paged pool can become exhausted. Increasing the SessionPoolSize and SessionViewSize registry values (also under Memory Management) can help, but this is more advanced. For most users, limiting the number of concurrent sessions is the practical fix.

Will this fix work on Windows 11?

Yes, the same registry keys and desktop heap mechanism exist in Windows 11. The steps are identical. However, Windows 11 has a slightly different default heap size, so you may need to adjust the numbers accordingly. The same safe maximum of 64 MB applies.

What if the registry edit doesn’t work?

If you’ve increased the heap and restarted, but the error persists, the problem may be a specific driver or application that is leaking GDI objects at an extreme rate. Use Task Manager to identify the process with the highest GDI object count and update or replace it. In rare cases, a corrupt system file can cause this; running sfc /scannow from an elevated Command Prompt can repair system files.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →