Helping people with computers... one answer at a time.

Pagefile.sys is the "paging file" or system file that contains Windows Virtual memory. You can remove it - if you understand the ramifications.

How to delete pagefile.sys. Is it safe to delete?

Sure, you can delete it. It takes some special steps, but it's not really all that difficult.

The problem is that you probably don't want to.

Pagefile.sys is the Windows paging file, also known as the file that Windows uses as Virtual Memory. As I've discussed before, Virtual Memory is simply disk space that Windows uses when it runs out of physical memory or RAM. Some of the contents of RAM are written out to disk to make room for whatever other memory request might have come in. If that "paged out" memory is needed again, some other RAM is written to disk and the previously written information is read back in.

Pagefile.sys is the file where Windows keeps all that:

Windows Explorer showing pagefile.sys

(Note that pagefile.sys is a system file, and thus in order to see the file in Windows Explorer "Show hidden files and folders" should be enabled and "Hide protected operating system files" should be disabled.)

"... Virtual Memory is simply disk space that Windows uses when it runs out of physical memory or RAM."

Now, since the file is being used by Windows, you can't just delete it. It'll either tell you permission denied, or "file in use" or something like that. Extra steps are required.

You'll probably notice that your paging file is roughly the same size as your configured virtual memory settings.

This leads to our first way to get rid of it: set your Virtual Memory to zero, and reboot. Once you return, Windows will no longer be using the file, and thus you can delete it.

If you have enough RAM in your system to handle the amount of memory needed to run the programs you run, you may not need VM at all. That happens to be how I run. (In fact, in researching this article I noticed I had a pagefile.sys when I did not expect one. I'd simply forgotten to delete it after setting my Virtual Memory to zero.)

Pagefile.sys will return if you re-enable virtual memory.

The other approach to deleting pagefile.sys is less useful, but I'll include it for completeness: boot into another operating system, and delete the file.

Quite literally, if you were to boot from a Linux Live CD, and explore your Windows hard drive you'll find, and should be able to delete, pagefile.sys.

We've done exactly what you asked for, but there's a problem.

As soon as you boot Windows, if you have Virtual Memory configured, pagefile.sys will return.

This approach is benign, but I'm guessing this isn't really what you were after.

Ultimately, unless you have some reason to be playing with your Virtual Memory settings, or know that you can run without Virtual Memory at all, I suggest simply leaving the settings, and pagefile.sys, the way they are.

Article C3603 - December 27, 2008

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
17 Comments

i read on another site to delete pagefile.sys: turn off (VM) reboot then delete pagefile.sys, then turn on (VM) again and 'click' "set". i did this but when i looked in C:pagefile.sys it was the exact size before i deleted it? (3,712,272) did i do something wrong ?

Posted by: scottt at October 20, 2009 8:33 PM

I just did a search on pagefile.sys. None for the desktop, one for the laptop. Should there not have to be on for the desktop?
Michael
Could this have anything to do with why Hibernation no longer works on my desktop?

Posted by: Michael at May 25, 2010 2:23 PM

One use for the delete/recreate cycle is to trade in a fragmented pagefile for a contiguous one. If the old file has grown and fragmented (perhaps as a consequence of increasing RAM), and (through defragmentation) you've got enough clear space for the entire pagefile, this trick will work. Or, you could buy an expensive defragment utility to do this explicitly. Usually a contiguous one-piece pagefile will provide better performance.

Posted by: Mikey at July 6, 2010 10:06 AM

I think its volume changes whenever I let my laptop be off for a while about a few hours.
Is it possible? Suppose I have something about 3 gigabyte hidden and I turn the laptop off. After a few hours being left off, its free space turns back.
Is this my illusions?

Posted by: Saeed azizieh at August 15, 2011 1:06 PM

Your second delete suggestion has a great use - when pagefile.sys gets infected with a virus. My antivirus is having issues removing it. Now that I know how to manually remove it, I'll fix the problem myself. Thanks!

Posted by: indnajns at August 18, 2011 4:50 AM
Post a comment on "Can I delete pagefile.sys? What is it?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...