Runtime Error 7 Out of Memory: How to Fix It on Windows
In this article
Runtime error 7 “Out of Memory” on Windows means a program asked for more RAM than Windows could give it at that moment. The fix is rarely a single button: close what is eating memory, raise the virtual memory (paging file) limit, and check that the app itself is not leaking memory. Start with the simplest step below and work down until the error stops appearing.
This guide is written for Windows 10 and Windows 11 on a desktop or laptop. Menu labels can differ slightly by Windows version, edition and region, so if a label is not exactly as written, look for the closest match in the same area of Settings or Control Panel.
What You'll Need
- Administrator rights on the PC (needed to change virtual memory and run some checks).
- Enough free disk space on the drive holding Windows, because the paging file lives there. A few gigabytes free is the practical minimum; more is better.
- The name of the program that shows the error, so you can target updates and settings at it.
- A restart you can afford, since several steps only take effect after one.
Step-by-Step
- Note exactly when the error appears. Write down the program name and what you were doing (opening a large file, exporting video, running many browser tabs). If the error only happens in one app, the problem is usually that app or its data, not Windows as a whole. If it happens across several apps, treat it as a system-wide memory problem.
- Close memory-hungry programs and browser tabs. Open Task Manager with Ctrl+Shift+Esc, click the Processes tab, and sort by the Memory column. Close anything large you are not using. Browsers with dozens of tabs are a common culprit, so close tabs or restart the browser. Then try the failing program again.
- Restart the PC properly. Use Start > Power > Restart rather than shutting the lid or sleeping. A full restart clears memory that a sleeping or fast-startup session can hold onto. Test the program after the restart before changing any settings.
- Check free disk space on the Windows drive. Open File Explorer, click This PC, and look at the C: drive. If it is nearly full, the paging file cannot grow and out-of-memory errors become much more likely. Free space by emptying the Recycle Bin, removing large downloads you no longer need, and using Settings > System > Storage to review what is taking space. Do not delete files you do not recognise.
- Increase the virtual memory (paging file) size. Press the Windows key, type advanced system settings, and open the result labelled View advanced system settings. In the System Properties window, go to the Advanced tab, click Settings under Performance, then open the Advanced tab in the Performance Options window and click Change under Virtual memory. Untick Automatically manage paging file size for all drives, select the Windows drive, choose Custom size, and set an initial size and a maximum size. A common starting point is 1.5 times your installed RAM for the initial size and 3 times for the maximum, in megabytes. For example, 8 GB of RAM is about 8192 MB, so an initial size near 12288 MB and a maximum near 24576 MB. Click Set, then OK, and restart the PC. If you are unsure, System managed size is the safer choice and often resolves the error on its own once disk space is available.
- Update the failing program and Windows. Install the latest version of the app from its official source, then check Settings > Windows Update and install pending updates. Restart after updating. Out-of-memory errors are sometimes fixed in newer builds of an app, especially in browsers, games and creative tools.
- Run the built-in memory diagnostic. Press the Windows key, type Windows Memory Diagnostic, open it, and choose Restart now and check for problems. The test runs before Windows starts and can take a while. If it reports hardware faults, the RAM itself may need reseating or replacing, which is a job for a repair shop on most laptops.
- Check for a memory leak in the app. Open Task Manager, use the failing program for a few minutes, and watch its memory figure. If it climbs steadily without you doing anything new, the app is leaking memory. The practical fixes are updating the app, reducing the size of the files or projects you open in it, and reporting the problem to the app's support channel.
- Reinstall the failing program as a last resort. Uninstall it from Settings > Apps > Installed apps, restart, then install the latest version from the official source. Back up any project files or settings first, because uninstalling can remove local data. Do not download installers from third-party download sites.
Common Mistakes
- Setting the paging file too small. A tiny custom size makes the error worse. If you are not confident in the numbers, leave it on System managed size.
- Changing virtual memory while the disk is full. The paging file needs contiguous free space; free some up first or the change will not help.
- Assuming the error means the RAM stick is broken. Most of the time it is a full disk, too many open programs, or one misbehaving app. Run the memory diagnostic before buying hardware.
- Ignoring which program triggers it. A single-app error and a system-wide error have different causes, and treating one as the other wastes time.
- Downloading “memory booster” or “registry cleaner” tools. These do not fix runtime errors and can cause new problems. Use only Windows' own tools and official app installers.
Tips
- Keep at least 10–15% of the Windows drive free so the paging file has room to work.
- Restart the PC after any virtual memory change; the setting does not apply until you do.
- If you regularly work with large files, close other apps first and save your work often so a crash costs you less.
- Use Task Manager's Startup tab to stop unnecessary programs launching with Windows; fewer background apps means more free memory for the one you need.
- Note the exact error text and the program version when asking for help; it makes support much faster.
Troubleshooting
The error still appears after increasing virtual memory. Recheck that the change was applied to the correct drive and that you restarted. Confirm the drive has free space. Then test with only the failing program open.
Windows will not let you change the paging file. Make sure you are signed in as an administrator. If the option is greyed out, the drive may be full or the page file may be managed by policy on a work PC; in that case, contact your IT administrator rather than forcing a change.
The memory diagnostic reports errors. Back up important files immediately, then have the RAM checked or replaced. Do not keep pushing the machine with large workloads until it is repaired.
Only one old program fails. Check whether a newer version exists. If the app is no longer maintained, reduce the amount of data you load into it at once, or use a current alternative.
The PC feels slow overall, not just one app. Review startup apps, uninstall programs you no longer use, and check for pending Windows updates. If the machine has very little RAM for the work you do, adding RAM is the real fix, but confirm the diagnosis first.
Frequently Asked Questions
Does runtime error 7 mean my RAM is broken?
No. It means a program could not get the memory it requested. Broken RAM is possible but uncommon; run Windows Memory Diagnostic to check before replacing hardware.
Is it safe to increase the paging file size?
Yes, within reason. It uses disk space on the Windows drive. Keep the drive from filling up, and use System managed size if you are unsure about custom values.
Will reinstalling Windows fix it?
It can, but it is the last resort and it removes installed programs and can remove files if you choose to keep nothing. Try the steps above first, and back up your data before any reset.
Why does the error only happen in one program?
That points to the program itself: a memory leak, a very large file, or an outdated version. Update it, reduce the workload, and check its memory use in Task Manager.
Can I fix it without administrator rights?
You can close programs, free disk space and restart, which often helps. Changing virtual memory and running the memory diagnostic need administrator rights.
Does adding more RAM help?
Only if the PC genuinely runs out of physical memory during your normal work. Confirm with Task Manager's memory figures and the diagnostic first; otherwise the cause is the app or the paging file.