Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Fix a Pagefile.sys Too Large Issue

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

If your Windows PC is running low on disk space and you notice that the file pagefile.sys is taking up tens of gigabytes, you can shrink it by adjusting the virtual memory settings. The pagefile is a hidden system file that Windows uses as extra RAM when physical memory is full. By default, Windows manages its size automatically, which can sometimes lead to it growing larger than necessary. You can fix this by setting a custom size that is smaller, or by moving it to another drive if your main disk is cramped. This guide walks you through the safe steps to reduce the pagefile size, and what to avoid so you don't destabilize your system.

What You'll Need

  • Administrator access to the Windows PC (you must be logged in with an account that has admin rights).
  • Knowledge of how much RAM your system has (you can check in Task Manager under Performance > Memory).
  • At least 10–15 GB of free space on the target drive to allow for the new pagefile (if you're moving it).

Step-by-Step

  1. Open System Properties. Press Win + R to open the Run dialog, type sysdm.cpl and press Enter. This opens the System Properties window. (Alternatively, go to Settings > System > About > Advanced system settings.)
  2. Access Performance Options. In the System Properties window, go to the Advanced tab and click the Settings button under the Performance section.
  3. Open Virtual Memory settings. In the Performance Options window, go to the Advanced tab and click the Change button under the Virtual memory section.
  4. Uncheck automatic management. At the top of the Virtual Memory dialog, uncheck the box that says “Automatically manage paging file size for all drives.” This allows you to manually control the pagefile.
  5. Select the drive and set a custom size. In the list of drives, select the drive where pagefile.sys currently resides (usually C:). Then select the Custom size radio button. Enter an Initial size and a Maximum size in MB. A common recommendation is to set both to 1.5 times your RAM size, but if you have 8 GB or more, you can often set it to 1024 MB (1 GB) or even 512 MB if you have plenty of RAM. For example, with 8 GB RAM, you could set Initial=1024, Maximum=2048. If you're unsure, set both to the same value (e.g., 2048 MB) to prevent the file from growing.
  6. Click Set, then OK. After entering the values, click the Set button, then click OK on all open dialog boxes.
  7. Restart your computer. For the changes to take effect, you must restart Windows. The old pagefile will be deleted, and a new one with your specified size will be created.
  8. Verify the new size. After restarting, open File Explorer, go to the drive, and check if pagefile.sys is now smaller. If it's still large, you may need to set a smaller maximum size or consider moving it to another drive (see Tips).

Common Mistakes

  • Setting the pagefile too small. If you set it to 0 or too low, Windows may crash or programs may fail to open when memory pressure is high. Always leave at least 512 MB, or let Windows manage it if you're not sure.
  • Forgetting to click “Set”. If you type values but don't click the Set button, the changes won't apply. Always click Set after entering the numbers.
  • Not restarting. The pagefile size won't change until you restart. A restart is mandatory.
  • Deleting pagefile.sys manually. Never delete the file directly in File Explorer. It's in use by the system, and you'll get an error. Only change it through the Virtual Memory settings.
  • Setting different initial and maximum sizes. If you set initial=1024 and maximum=8192, the file can still grow to 8 GB. To keep it small, set both values to the same number.

Tips

  • Move the pagefile to another drive. If your C: drive is full, you can move the pagefile to a different internal drive (e.g., D:) to free up space on C:. In the Virtual Memory dialog, select C:, choose No paging file, click Set, then select the other drive and set a custom size. This is especially useful if you have an SSD for the OS and a secondary HDD.
  • Let Windows manage it if you have low RAM. If your PC has 4 GB or less of RAM, it's safer to keep the pagefile on automatic management. The system will grow it as needed, which can be large, but it prevents crashes.
  • Consider adding more RAM. If your pagefile is constantly huge (e.g., 20 GB), it's a sign that your system is running out of physical memory. Adding RAM is the real fix and will reduce the pagefile's size naturally.
  • Check for memory leaks. If the pagefile grows over time even after a restart, a background program might be leaking memory. Check Task Manager for processes using high memory.

Troubleshooting

If the pagefile is still large after restart: First, verify that you actually clicked Set and that the custom values are saved. Reopen the Virtual Memory dialog and confirm the values are there. Also, make sure the drive has enough free space; if not, Windows may ignore your settings and use a larger file.

If you get an error saying “Insufficient system resources” after changing the size: This usually means the pagefile is too small for your current workload. Restart in Safe Mode, revert to automatic management, and then try a slightly larger custom size (e.g., 2048 MB initial, 4096 MB max).

If you can't change the settings (options grayed out): Make sure you are logged in as an administrator. If you are, and the options are still grayed out, check if your system is managed by group policy (common on corporate PCs). Contact your IT admin.

If the pagefile is on a different drive and you want to move it back: Follow the same steps, but select the original drive and set a custom size or let Windows manage it. Then set the other drive to “No paging file”.

If Windows crashes after you set a small pagefile: Boot into Safe Mode (press Shift while clicking Restart in the Start menu, then troubleshoot > advanced options > startup settings > restart > press 4). Then revert to automatic management or increase the size.

Frequently Asked Questions

Is it safe to delete pagefile.sys?

No. Windows needs a pagefile for virtual memory. Even if you have lots of RAM, Windows uses the pagefile for certain system operations. You can set it to a small size, but don't delete it entirely.

Why is my pagefile.sys so large?

Windows grows the pagefile automatically when physical RAM is under pressure. If you have many programs open or a memory leak, it can grow to several gigabytes. Also, if you have a small SSD, the default “system managed” size can be disproportionately large.

Can I move pagefile.sys to another drive?

Yes. In the Virtual Memory dialog, select the current drive, choose “No paging file”, click Set, then select a different drive and set a custom size or let Windows manage it. This frees up space on your main drive.

What is the recommended pagefile size for 8 GB RAM?

For 8 GB RAM, a common recommendation is to set initial and maximum to 1024–2048 MB. If you run heavy applications like video editing, you might need more. Otherwise, 1–2 GB is sufficient for most desktop use.

Will changing the pagefile size affect performance?

If you set it too small, you may get “out of memory” errors or slowdowns. If you set it to a reasonable size (like 1.5x RAM), performance should be fine. The pagefile is only used when RAM is full, so if you have enough RAM, a smaller pagefile won't hurt performance.

Why can't I see pagefile.sys in File Explorer?

It's a hidden system file. To see it, open File Explorer, go to the View tab, check “Hidden items”, and uncheck “Hide protected operating system files”. You'll then see it, but you still shouldn't delete it manually.