Fix 'Not Enough Memory' Error in Games on Windows 10/11
You get this error even with free RAM? It's usually a virtual memory or pagefile issue. Here's the real fix.
You're Not Out of RAM — It's the Pagefile
You're mid-game in something like Baldur's Gate 3 or Call of Duty: Warzone, and Windows slaps you with a cryptic 'Not Enough Memory' error. You check Task Manager — you've got 8 GB free. What's actually happening here is that the game is hitting the virtual memory limit, which is tied to the size of your pagefile (paging file). Games, especially modern ones, pre-allocate memory and assume a certain committed charge limit. If the pagefile is too small, Windows refuses the allocation even if physical RAM is available.
Quick Fix: Increase the Pagefile Size
Don't mess with overclocking or buying more RAM yet. Try this first — it fixes 90% of cases.
- Press
Win + R, typesysdm.cpl, hit Enter. - Go to the Advanced tab, under Performance click Settings.
- In the Performance Options window, go to Advanced tab, under Virtual memory click Change.
- Uncheck 'Automatically manage paging file size for all drives'.
- Select your primary drive (usually C:), choose Custom size.
- Set Initial size to
16384MB (16 GB), Maximum size to32768MB (32 GB). - Click Set, then OK. Restart your PC.
That's it. The error should be gone after reboot.
Why This Works
The 'Not Enough Memory' error in games is almost never about physical RAM — it's about the committed charge limit. The committed charge limit is the total amount of virtual memory that Windows can hand out to all processes combined. It equals: physical RAM + current pagefile size. If your pagefile is set to 'System managed size', Windows keeps it small to save disk space, often around 4–8 GB. When a game tries to allocate a large chunk (say 12 GB of virtual memory), Windows says no because the committed charge limit is too low. By setting a larger pagefile, you raise that limit. The game's allocation succeeds, and it happily runs.
A side note: you might think 'I have 32 GB RAM, I don't need a pagefile'. Bad idea. Some games and applications require a pagefile to exist, even if they never use it. Doom Eternal outright refuses to launch without one. So leave at least 16 GB in there.
Less Common Variations
If the fix above didn't work, the issue might be something else. Here are three less common culprits and their fixes.
1. Drive Space is Too Low
The pagefile needs free space to expand. If your system drive has less than 20 GB free, Windows can't grow the pagefile. Check C:\ free space. If it's under 20 GB, clean up some files or move the pagefile to another drive.
Fix: Free up space, or in Virtual Memory settings, select a different drive with more room (e.g., a fast SSD). Set custom size same as above.
2. Memory Leak in the Game or Driver
Some games have a known memory leak — Forza Horizon 5 had this early on. Or a GPU driver (like Nvidia 536.xx) can leak memory. The error might show up after 30 minutes of play.
Fix: Update your GPU driver to the latest. For older games, try running in DirectX 11 mode (add -dx11 to launch options in Steam). Monitor RAM usage in Task Manager — if it climbs indefinitely, that's a leak.
3. DEP or Data Execution Prevention
Windows might be blocking the game from allocating executable memory. This is rare but happens with older cracked games or certain anti-cheat software.
Fix: Add the game executable to DEP exception list. Go to System Properties > Advanced > Performance Settings > Data Execution Prevention. Choose 'Turn on DEP for all programs and services except those I select', then add the game's .exe.
Preventing This Going Forward
Set your pagefile to a fixed size — 16 GB initial, 32 GB maximum — on your fastest drive. Don't rely on 'System managed size' for gaming. It's too conservative. Also, keep at least 20 GB free on that drive. If you upgrade your RAM later (say to 64 GB), you can lower the pagefile to 8 GB initial / 16 GB max, but never disable it entirely. And if you're on a laptop, make sure it's plugged in and not in power-saving mode — some power plans throttle memory allocation.
One extra tip: if you have multiple drives, put the pagefile on the fastest one (NVMe SSD over SATA SSD). It won't speed up gaming much, but it'll prevent weird stutters when Windows does page something out.
Was this solution helpful?