What pagefile.sys is and why you might want to remove it

Pagefile.sys is a hidden file Windows creates on your hard drive to act as overflow memory. When your computer runs out of RAM, Windows writes data to this file instead of stopping. On modern computers with 16 GB of RAM or more, you often do not need it — your actual RAM is fast enough to handle what you do, and the pagefile just sits there taking up space.

Deleting pagefile.sys frees up disk space and can slightly speed up your system by removing a file Windows checks constantly. However, if you have less than 8 GB of RAM, you should keep it. If you disable it and your RAM fills up, programs will crash instead of slowing down gracefully.

The safest approach is to shrink the pagefile rather than delete it entirely. This gives you back most of the space while keeping a small safety net if you ever need it.

Key Takeaways

  • Pagefile.sys is a virtual memory file that only matters if your RAM runs out, so you can safely remove it if you have 16 GB of RAM or more.
  • Shrinking the pagefile to a small fixed size (like 1 GB) is safer than deleting it entirely, because it frees space while protecting against crashes if RAM fills up.
  • You must restart your computer after changing pagefile settings, and you cannot delete the file while Windows is running — you can only disable it through System settings.
  • If you have less than 8 GB of RAM, keep the pagefile at its current size or larger, because removing it will cause crashes when programs demand more memory than you have.

How to shrink pagefile.sys to a smaller fixed size

Shrinking the pagefile is the middle ground: you keep it for safety but reclaim most of the space. Open the Start menu and type View advanced system settings, then press Enter. In the window that opens, click the Settings button under "Performance."

In the Performance Options window, click the Advanced tab at the top. Under "Virtual memory," click Change. Uncheck the box that says Automatically manage paging file size for all drives. Now you can set a custom size.

Select your main drive (usually C:) and choose Custom size. Set both the initial size and maximum size to the same number — 1024 MB (1 GB) is a safe choice for most people with 16 GB of RAM or more. Click Set, then OK. Restart your computer when prompted.

How to completely disable pagefile.sys

If you have 32 GB of RAM or more and want to remove the pagefile entirely, you can disable it. Follow the same steps as above: Start menu, View advanced system settings, Settings under Performance, Advanced tab, then Change under Virtual memory.

Uncheck Automatically manage paging file size for all drives. Select your main drive and choose No paging file, then click Set. Click OK and restart your computer.

After restart, the pagefile.sys file will no longer exist. If you ever need it back, return to the same settings and choose System managed size to let Windows recreate it automatically.

Checking how much space pagefile.sys is using

Before you change anything, it helps to know how large your pagefile actually is. Open File Explorer and click the View tab at the top. Check the box for Hidden items so you can see system files.

Navigate to your C: drive (or whichever drive holds Windows). Look for a file called pagefile.sys — it will have no icon. Right-click it and select Properties to see its size. On many computers, this file is between 2 GB and 8 GB, so shrinking it to 1 GB or disabling it entirely can free up meaningful space.

What to do if your computer crashes after disabling pagefile.sys

If you disabled the pagefile and now programs crash or your system becomes unstable, re-enable it when ready. Return to View advanced system settings > Settings > Advanced > Change under Virtual memory, select your drive, and choose System managed size. Restart your computer.

This usually means your RAM is filling up during normal use, which means you either need more RAM or you have a program using far more memory than it should. Check Task Manager (press Ctrl+Shift+Esc) to see which programs are consuming the most memory, and consider closing or uninstalling ones you do not use.

When you should keep pagefile.sys at full size

If you have 8 GB of RAM or less, do not shrink or disable the pagefile. Your system needs it. Modern programs like web browsers, video editors, and games can easily use 6 GB or 7 GB of RAM, leaving little room before you run out. The pagefile prevents crashes when that happens.

Even if you have 16 GB of RAM, if you regularly run memory-heavy programs like Photoshop, video rendering software, or virtual machines, keeping the pagefile at its default size is safer. The small disk space cost is worth avoiding a crash in the middle of work.

Frequently Asked Questions

Will deleting pagefile.sys make my computer faster?

Slightly, but only if your RAM never fills up. If you have enough RAM for what you do, Windows will not use the pagefile anyway, so it makes no difference. If RAM does fill up and you disabled the pagefile, your computer will crash instead of slowing down — that is slower.

Can I delete pagefile.sys directly from File Explorer?

No. Windows locks the file while it is running, so you cannot delete it manually. You can only disable it through System settings, which tells Windows to stop using it. After you restart, Windows will not recreate it.

What is the difference between initial size and maximum size?

Initial size is what Windows creates when it starts. Maximum size is the largest it can grow if needed. Setting them to the same number (like 1024 MB for both) prevents Windows from expanding the file, which saves space and slightly improves performance by removing that overhead.

If I shrink pagefile.sys to 1 GB, will I lose data?

No. The pagefile is temporary memory overflow — it holds data only while programs are running. When you restart, it is cleared. Shrinking it just means Windows has less overflow space available, not that you lose saved files.

How do I know if my RAM is enough and I do not need pagefile.sys?

Open Task Manager (Ctrl+Shift+Esc), click the Performance tab, and select Memory. Watch it while you use your computer normally. If the "In use" number stays well below your total RAM (like using 10 GB out of 32 GB), you do not need the pagefile. If it regularly climbs above 80 percent of your total, keep the pagefile.