What Is the Windows Page File, and How Do You Configure It?

News

HomeHome / News / What Is the Windows Page File, and How Do You Configure It?

May 12, 2024

What Is the Windows Page File, and How Do You Configure It?

No, disabling it won't speed up your PC. The Windows page file stores data when there's no room for it left in your computer's RAM. It's a hidden system file located at C:\pagefile.sys by default. The

No, disabling it won't speed up your PC.

The Windows page file stores data when there's no room for it left in your computer's RAM. It's a hidden system file located at C:\pagefile.sys by default. The page file is often called "virtual memory," while your computer's RAM is referred to as "physical memory."

Windows uses a page file to store data that can't be held by your computer's random-access memory when it fills up. While you can tweak the page file settings, Windows 10 and Windows 11 can manage the page file just fine on their own.

The page file is a hidden system file used by the Windows operating system. Windows stores data in this file when your computer's RAM fills up. The page file is often called "virtual memory" to distinguish it from RAM, which is "physical memory."

Also known as the swap file, pagefile, or paging file, the page file is located at C:\pagefile.sys by default, but it's hidden by default. You won't see it unless you tell File Explorer to show protected operating system files. You may also have multiple paging files on different drives if your computer has multiple drives.

Windows may move data your computer isn't using from RAM to the page file to free up space in your RAM pre-emptively. This all happens automatically in the background.

All versions of Windows have the page file. It's present on Windows 10 and Windows 11, and you'll also find it on older versions of Windows like Windows 7 and Windows XP. The good news is that your page file will perform more quickly on a modern PC with a speedy NVMe drive or another type of SSD than an older, slower mechanical hard drive.

Macs running macOS and Linux systems use "swap" space rather than a page file. The page file is the Windows version of a swap file. (On a Mac, a "Pages" file is a document created by iWork. Pages is a word processor created by Apple---think of it like Apple's Microsoft Word competitor.)

The Windows page file is occasionally misunderstood. People sometimes see it as the cause of slowdowns because it's slower to use the page file than your computer's RAM, but having a page file is better than not having one.

Your computer stores files, programs, and other data you're using in your RAM (random access memory) because it's much faster to read from RAM than it is to read from a hard drive or even an SSD. For example, when you open Google Chrome, Chrome's program files are read from your computer's storage and placed into your RAM. The computer uses the copies in RAM rather than repeatedly reading the same files from your SSD or hard drive.

Programs store the data they're working with here. When you view a web page, the web page is downloaded and stored in your RAM. When you watch a YouTube video, the video is held in your RAM.

When your RAM becomes full, Windows moves some of the data from your RAM back to your system's storage, placing it in the page file. While writing this data to your storage and reading it back later is much slower than using RAM, it's backup memory. Rather than throwing potentially important data away or having programs crash, the data is stored on your SSD or hard drive.

Windows will try to move data you aren't using to the page file. For example, if you've had a program minimized for a long time and it isn't doing anything, its data may be moved from RAM to your page file. If you maximize the program later and notice that it takes a while to come back instead of instantly snapping to life, it's being swapped back in from your page file. If your computer has a storage indicator light, you'll see the light blinking as this happens. However, with modern computers and fast SSDs, it might happen so fast you don't even notice.

If your computer has enough RAM, it shouldn't be using the page file a lot in typical use. If programs start to slow down when you have a large number of them open---or when you have a lot of browser tabs open---that's an indication your computer may be using the page file. If your computer's RAM appears nearly full, you may be able to speed things up by adding more RAM. You can also try freeing up memory -- for example, by closing programs you aren't using.

You can see how much RAM is in your computer and how full it is from the Resources tab in the Windows Task Manager.

Some people will recommend disabling the page file to speed up your computer. The thinking goes like this: the page file is slower than RAM, and if you have enough RAM, Windows will use the page file when it should be using RAM, slowing down your computer.

This isn't really true. People have tested this theory and found that, while Windows can run without a page file if you have a large amount of RAM, there's no performance benefit to disabling the page file.

However, disabling the page file can result in some bad things. If programs start to use up all your available memory, they may start crashing instead of being swapped out of the RAM into your page file. This can also cause problems when running software that requires a large amount of memory, such as virtual machines, media creation applications, and demanding PC games. Some programs may even refuse to run.

In summary, there's no good reason to disable the page file -- you'll get some storage space back, but the potential system instability won't be worth it.

It's true that SSDs have a limited lifespan---a fixed number of writes before they can no longer be written to. Some people choose to disable the page file for this reason, to prolong SSD lifespan. However, modern SSDs can take so many writes that we don't think this is a big concern. It will likely be time to replace your computer long before the SSD fails. (Unless Windows is writing a lot to the page file---in which case, there's a good chance you will want that faster performance from the page file anyway.)

Windows automatically manage the page file's settings for you by default. We recommend sticking with the default settings.

However, if you want to adjust settings like your page file's size or location, you can do so from the Advanced System Settings window. To launch it, open the Start menu and type "Advanced System Settings" into the Start menu. Click "View Advanced System Settings" or just press Enter to open it.

Click the "Settings" button under the Performance section.

Click over to the "Advanced" tab in the Performance Options window. Click the "Change" button in the "Virtual memory" section.

Since Windows automatically manages your page file settings by default, the options here will by grayed out. We recommend sticking with the default options. With the System Managed Size option, Windows will automatically choose a good size for the page file.

To configure these options yourself, uncheck "Automatically manage paging file size for all drives." You can then select each drive in your computer (if it has multiple drives) and, for each, choose between a "Customize Size" you can configure, "System Managed Size," and "No Paging File." After changing the settings for a drive, click "Set" to save your changes.

If you set a drive to "No Paging File," Windows will delete the Pagefile.sys file.

For maximum performance, be sure your page file is located on your computer's fastest drive. For example, if your computer has both a slower mechanical hard drive and a faster solid-state drive, you'll want the paging file on your SSD to ensure writing to it and reading from it is as fast as possible.

In most situations, this should hopefully be the default---you probably want to keep your Windows system files on your fastest drive to ensure the operating system is nice and speedy, for example. In this case, the default location on your C: drive will work well.

If you have several drives in your computer and they're a similar speed, assuming one is the system drive with your programs installed on it and one is a less-used data drive, moving the page file to the data drive can potentially offer some increased performance when your page file is in-use. Assuming that Windows will already be using the system drive if it needs to use the page file, this spreads out the read-write activity instead of concentrating it on one drive.

However, this will help the most if your computer is frequently using its page file. If that's the case, you can get a bigger performance improvement by upgrading your PC's RAM.

Be sure to keep the page file on your fastest drive! For example, many computers now have a speedy SSD as a system drive and a slower mechanical hard drive as a secondary data drive. In this case, you should definitely leave your page file on the fast SSD and not move it to a slower hard drive.

Note that this will only help if you actually have two separate physical drives in your computer. If you have one SSD or hard drive separated into multiple partitions, each with its own drive letter, this won't do anything. Whether it's partitioned or not, it's still the same physical drive.

Windows also stores Swapfile.sys and Hiberfil.sys files alongside the Pagefil.sys file.

The Swapfile.sys file is very small (on our Windows 11 PC, ours was just 16 MB as opposed to the 16 GB page file.) It's used for some other purposes, especially those related to "universal" apps on modern versions of Windows.

When you disable the page file on a drive using the options in Advanced System Settings, Windows 10 and Windows 11 will also delete the Swapfile.sys file.

The Hiberfile.sys file is used for hibernating your PC. Hibernating is an alternative to sleep mode that uses no power. In sleep mode, your computer saves its data to RAM and uses a small amount of electricity to power the RAM and maintain the data. It can then turn on very quickly when you start using it again, restoring the last state you used it in. In hibernation mode, your computer saves the state of its ram to the Hiberfile.sys file on its storage and shuts down. It can then use no energy---this is particularly great for laptops, as the battery won't drain. When you boot up the computer again, it can restore the state it was in complete with all your open applications by loading it from the Hiberfile.sys file. Of course, this is slower than simply restoring it from RAM.

Computers---especially laptops---often go to sleep and then, after spending a while in sleep, go into hibernation mode to save additional power. The only way to delete the Hiberfile.sys file is by disabling hibernation mode on your PC.

In summary, the page file is an essential part of Windows 10 and Windows 11. Even if it's rarely used, it's important to have it available when programs use an unusually large amount of memory.

Having a page file won't slow down your computer---but ,if your computer is using its page file a lot, you should probably get some more RAM.

Related: What Is the .GamingRoot File on Windows?

Chris Hoffman is the former Editor-in-Chief of How-To Geek. Chris has personally written over 2,000 articles that have been read more than one billion times---and that's just here at How-To Geek.With over a decade of writing experience in the field of technology, Chris has written for a variety of publications including The New York Times, Reader's Digest, IDG's PCWorld, Digital Trends, and MakeUseOf. Beyond the web, his work has appeared in the print edition of The New York Times (September 9, 2019) and in PCWorld's print magazines, specifically in the August 2013 and July 2013 editions, where his story was on the cover. He also wrote the USA's most-saved article of 2021, according to Pocket.Chris was a PCWorld columnist for two years. He founded PCWorld's "World Beyond Windows" column, which covered the latest developments in open-source operating systems like Linux and Chrome OS. Beyond the column, he wrote about everything from Windows to tech travel tips.The news he's broken has been covered by outlets like the BBC, The Verge, Slate, Gizmodo, Engadget, TechCrunch, Digital Trends, ZDNet, The Next Web, and Techmeme. Instructional tutorials he's written have been linked to by organizations like The New York Times, Wirecutter, Lifehacker, the BBC, CNET, Ars Technica, and John Gruber's Daring Fireball. His roundups of new features in Windows 10 updates have been called "the most detailed, useful Windows version previews of anyone on the web" and covered by prominent Windows journalists like Paul Thurrott and Mary Jo Foley on TWiT's Windows Weekly. His work has even appeared on the front page of Reddit.Articles he's written have been used as a source for everything from books like Team Human by Douglas Rushkoff, media theory professor at the City University of New York's Queens College and CNN contributor, to university textbooks and even late-night TV shows like Comedy Central's @midnight with Chris Hardwick.Starting in 2015, Chris attended the Computer Electronics Show (CES) in Las Vegas for five years running. At CES 2018, he broke the news about Kodak's "KashMiner" Bitcoin mining scheme with a viral tweet. A wave of negative publicity ensued, with coverage on BuzzFeed News, CNBC, the BBC, and TechCrunch. The company's project was later reportedly shut down by the U.S. Securities and Exchange Commission.In addition to his extensive writing experience, Chris has been interviewed as a technology expert on TV news and radio shows. He gave advice on dark web scans on Miami's NBC 6, discussed Windows XP's demise on WGN-TV's Midday News in Chicago, and shared his CES experiences on WJR-AM's Guy Gordon Show in Detroit.Chris also ran MakeUseOf's email newsletter for two years. Nearly 400,000 subscribers received the newsletter complete with a handwritten tip every day.