What Is Pagefile.sys? Can I Delete It?
Hi, everyone. Leo Notenboom here for Askleo.com.
This is one of those common questions
that a lot of people wonder about once they stumble across Pagefile.sys
And they see how large it is in short Pagefile.sys.
This is a file that is created and used
by Windows to hold what's called virtual memory.
Virtual memory is essentially the operating systems using disk space
in lieu of actual RAM, in lieu of actual memory when the system runs out of RAM.
So, for example, say you have eight gigabytes of RAM
on your system, but the software that you're running
somehow ends up wanting to use in total 10.
So you're wanting to use more RAM than you actually have installed in your system.
What Windows will do is it will start looking at how the RAM is currently being
used and it will take the stuff that hasn't been used in a while,
whatever that might be, and actually write it to disk that way.
That memory, the actual physical RAM can
be freed up and used by whoever else is needing RAM at that point in time.
The disk that it's written to is this file called Pagefile.sys.
Paging is the operation of actually writing blocks or pages of memory onto
disk and when they're needed. Later reading them back in. So it can get fairly
complicated, it can get fairly disk intensive if you're actually using
a lot more RAM than you physically have installed in your machine.
So can you get rid of it?
Well, yes, you can.
First, let's go to the machine and have a look at Pagefile.sys.
So this is my Windows 10 home machine,
I'm just going to fire up Windows Explorer here and go to the root of my C drive.
And you can see that there's nothing here. That means I need to change some options
or go over to options, change folder and search options
in the View tab, there's a number of options that I often like to play with.
The one we care about here is this Show Hidden Files, Folders and Drives.
We're also going to unclick hide
extensions because that's a security issue that I really, really don't like.
And then we're also going to uncheck hide protected operating system files.
Eeven though there's a warning this is exactly what we want.
I'll hit, OK? And now you can see there are a lot more
files here in the root of C than we originally thought.
And sure enough, one of those files is Pagefile.sys.
You can see here that it is a gigabyte and a half of disk space.
It's more or less proportional to the amount of memory you have in your system.
Exactly what its default settings are vary depending on a number of different
things, but it is something that you can control now.
Of course, one of the things we want to do
right away is see if we could just delete it.
But of course we can't.
The file is open in another program Pagefile.sys
is always open by windows if
the system is configured to use virtual memory at all.
So what that means is that you can't
delete it, at least not the way we're set up right now.
So in order to change the paging file,
we will go to system properties, system item
and then scroll down in system to advanced system settings.
In advanced system settings will hit the advanced tab and you'll see
that there's a performance item here that includes virtual memory.
We'll click on settings.
We'll click on Advanced yet again down in virtual memory there.
It tells us.
Yep, we've got one point four gigabytes worth of paging file.
Let's change that.
Now, this is the default setting where
Windows actually manages the paging file for you.
That is a fine default setting,
unless for some reason, you know, you want to do something different.
And as you can see here,
we have the option to move the paging file to potentially different drives.
We have the option to turn it off completely.
And that's what I'm going to do now.
Well, uncheck the automatically managed
paging file size for all drives so that the system paging file,
location and size is now completely under our control for the C drive.
It says system manage.
I'm going to say no paging file and hit set.
Now, you'll notice, of course,
that it's warning us that this may cause problems down the line.
The issue is that without a paging file, you have the possibility of running out
of memory sooner than you would if you had a paging file.
If you've got a paging file enabled and you allow windows to control its size,
Windows can essentially assign as much memory as your programs need,
regardless of how much ram you have installed in your system.
There's a performance hit because,
of course, you're hitting the disk instead of just using RAM, which is faster.
But if you know that you will never ask
for more RAM than actually is installed in your system, this is what you can do.
So do I want to continue?
Yes, I do.
And you can see here now the paging file size is none, none, none and none.
In other words, once I'm done, there will not be a paging file.
I'm going to click, OK?
And you can see that, yes,
it's going to require a reboot for this change to take effect.
I'm going to OK my way back out until it says restart now and we'll do that.
And we're back.
Go ahead and sign in to windows.
Naturally, it's still booting
in the process of starting up, so things will be a little bit slower,
but nonetheless, we can go right ahead and fire up Windows File Explorer,
go back to the root of our C drive, to make this a little bit bigger this time.
And you'll see that, well, the paging file is gone.
Had it's still been present,
you would have been able to delete it yourself at this point in time.
But Windows is nice and it's cleaned up
after itself and it's actually removed the paging file for you.
The other approach, of course,
is to use a different operating system to boot into, say, a live Linux CD or DVD
so you can actually access the contents of the hard drive.
While Windows isn't running itself
in a situation like that, since Windows is not running,
it won't have the file locked and you can, in fact, delete the file.
Here's the problem.
If you don't change the Windows
configuration to actually no longer require or use a swap file or paging file,
it'll be automatically recreated the next time you boot into windows.
So the only way to get rid of the paging
file is to turn off the use of virtual memory in windows.
It's not something I recommend you do.
You can if you know that you're always going to have a lot of ram available
for all the applications you're running, but in general, we don't.
In general, there's always situations where we suddenly forgot that we have too
many browser tabs open and rather than failing on us, Windows starts to manage
the virtual memory for us so that things don't crash.
I hope that was helpful.
I hope that was a little informational for updates.
For more detail on this,
for related links and more, visit Askleo.com/15171.
I'm Leo Notenboom.
This is Askleo.com.Thanks for watching.