Alright, today we’re going to talk about memory!
I’m excited to give you the lowdown on an often misunderstood topic: The Windows Page File. In this guide I’ll answer the following questions:
- What is the Windows Page File?
- Will disabling it improve performance?
- What the heck is pagefile.sys and swapfile.sys?
By the end of the post you’ll not only be a smarter person but also feel smarter too. Now seriously: who doesn’t want to feel smart?
Read on my friend.
The Windows Page file is like a hard drive backup for your RAM; that is, the physical memory. When your RAM fills up, the excess overflows into the pagefile.
The pagefile is also known as virtual memory because it attempts to emulate RAM. The major difference between the two is that the CPU can get data in and out of RAM faster than it can exchange data in and out of the pagefile sitting on your hard drive.
So your PC will only use the pagefile when it needs it. If you have loads of RAM or you don’t kill your computer with a bunch of concurrently running programs, you’ll probably never use the pagefile.
But what exactly is it?
The pagefile is an actual file sitting in the root of your system directory. Let’s take a look at yours.
Press the Windows logo Key + the letter e to open Explorer.
Next, press Alt + v then hit the y key and then press the o “oh” key. This will open Folder Options.
We need to click the View tab and uncheck Hide protected operating system files (Recommended) so we can view pagefile.sys. You’ll get a warning when you do this but that’s a good thing.
If you accidentally (or intentionally) tried to delete a Windows System file you could not only make the OS volatile but also irrevocably crash your computer. So Windows is trying to protect you from making a fatal mistake.
But we’re not going to change any Windows system files; I just want you to see the pagefile for yourself.
There are a few things to note here:
First notice my pagefile.sys is almost 3GB. I’ll show you why in a moment. The point for now is when physical memory is maxed, Windows swaps it into pagefile.sys to prevent the application from crashing. Your pagefile becomes a virtual, slower, extension of your RAM but without it, your memory starved program would freeze up pretty hard.
If you notice your physical memory is constantly low then your computer is probably swapping files to the page file on the disk. If you put your ear near the computer or look at the hard drive activity light you should hear or see the computer writing to disk. If this only happens occasionally it’s okay; however, if it’s happening all the time you should consider adding more RAM.
Did you see that other file there? The other thing is that swapfile.sys business. What the heck is that?
According to Pavel Lebedinsky of Microsoft, swapfile.sys is a unique pagefile designed to make certain paging operations more efficient. For example, suspending and resuming Modern Apps could use swapfile.sys instead of pagefile.sys. Keeping swapfile.sys distinct from pagefile.sys allows Microsoft the flexibility to evolve the operating system in the future.
Should I disable pagefile.sys
If you google around the internet for the answer you’ll see a few forums suggesting that you should disable pagefile.sys to improve system performance. Some people also that you should remove it to reclaim a few gigabytes of hard drive space. Furthermore, I think some people believe that since it’s slower to write to pagefile.sys than to RAM you should disable pagefile.sys. But this is fallacious logic.
The PC only uses pagefile.sys when the physical memory resources are exhausted; so what happens when you peg your memory and there’s no virtual memory file to write to?
The application locks up.
If you can’t afford more RAM but want to optimize performance you can do two things:
Move the pagefile to a different disk
Move the pagefile the a different physical hard disk. Not a different partition but a completely separate physical disk. Multiple partitions are on the same drive so shifting the pagefile from one partition to the next won’t do you any good. We need to move it to a different physical hard drive.
If you’re really crazy about this sort of thing the pagefile should be the difference between your Peak Commit and Physical RAM. So if you have 8GB of RAM and the apex of your memory usage topped off at 6GB, you should set your pagefile to be at least 2GB and the maximum should double that. So you would set the Maximum to 4GB.
Kill the crapware
Sometimes the most effective way to speed up your system is also the cheapest. Simply uninstalling unused programs can go a long way. Press the Windows Key and type:
programs and features
Block out a Saturday afternoon and just start uninstalling trialware, forgottenware, and every other kind of ware you can think of lol.
Purge the crap from your system and your computer will thank you later.
I never use Adobe Premiere Pro so I’m getting rid of this one. It’s a trial anyway so I’m not losing anything because I can always download it when I need it.
Checking the pagefile settings
You really shouldn’t modify your default pagefile settings because Windows already handles this but if you want to take a look follow me:
Press Windows Key + w and type and enter
Go to the Advanced Tab and click the first Settings button under the Performance section.
This will wisk you away to the Performance Options screen.
Inside here, click a new Advanced Tab and then click the Change button in the Virtual Memory section.
Remember when we viewed pagefile.sys and it showed that it was close to 3GB? Well here is where that value is derived from. You can see that the Total paging file size for all drives is set to 2.6GB (2,688 MB) which is basically 3GB.
I think it’s prudent to let Windows automatically manage your paging file sizes. You can try tweaking the values if you want but I’ve never been able to produce an appreciable change that way.
The Bottom Line
So there you have it.
What is the Windows Paging file? When you use your computer to load programs, stream videos and fire off angry emails to your boss – all those applications are loaded from RAM. When RAM is exhausted, Windows loads programs from a file on the hard drive called pagefile.sys.
You should never disable pagefile.sys because it will always produce a deleterious result. Instead of disabling it, either by more RAM, move the pagefile to a different disk or purge your computer from useless software.
Incidentally, I just realized I should clarify something. When I say move the pagefile.sys to another disk I don’t mean cutting pagefile.sys from C:\ and pasting it into another drive. I mean going to Performance Options, opening the virtual memory screen and unchecking Automatically manage paging file size for all drives. When you do that you can select the drive you want to use as your paging drive.
One other thing, make sure you go back into Windows Explorer and hide your system files again. I would hate for you to accidentally delete a crucial system file since they’re visible.
To hide your system files again, press Alt + v + y + o, go back to the View tab, scroll down to Hide protected operating system files (Recommended) and make sure it’s checked. Click OK and you’re back to normal again.
Alright so that’s all for now. What do you think about Windows page files now? Please share your questions or wisdom in the comments below!