What is pagefile.sys and can I move it?

If you've added a hard drive to your system you can move pagefile.sys to free up space on your original drive and speed up your system.


There’s a large hidden file on my disk that’s taking up a bunch of space called pagefile.sys. What is pagefile.sys? Assuming it’s something I need, can I move it to another drive?

Pagefile.sys is your Windows virtual memory swap file. When the applications you’re running on your computer end up needing more RAM than you actually have, Windows will start shuffling things around and use your hard disk as “virtual” memory. At the sometimes high cost of speed (your hard disk, and thus virtual memory, is much slower than actual RAM) you avoid getting an out of memory error.

Pagefile.sys is the area that Windows sets aside for that.

And yes, you can move it. In fact, if you have more than one drive installed on your machine and your system uses virtual memory often, moving it can result in a performance boost.


When Windows creates pagefile.sys it typically makes it a “large” size – usually the size of RAM installed on your machine. For example on the machine I’m using now I have 8 gigabytes of RAM, and sure enough:

C:> dir /a:h

07/03/2010 06:07 AM 8,589,008,896 pagefile.sys

(In the Windows command shell, “dir” lists the directory contents, and “/a:h” indicates that it should list files whose attributes include hidden.)

Particularly if you never use the paging file, that’s space wasted.

In addition, if you have an additional hard drive installed in your machine it can often be helpful to place the paging file on a different drive. Not only does this free up space on “C:”, but it can reduce hard disk contention caused by heavy use of C: by offloading some of the activity to a different drive.


Be it for performance or for disk space, moving pagefile.sys is pretty easy.
  • It needs to be a different physical drive. Moving the paging file to a different partition on the same drive will probably just slow things down further as the disk heads on that drive need to move further as they access information from the original drive and the new location of the paging file.
  • It should not be on a USB (or Firewire) external drive. Not only are these interfaces often too slow to positively impact performance, accidentally pulling the cable will crash your machine.
  • It should not be a flash drive. Flash memory wears out, and heavy swap file usage can wear out flash memory exceptionally quickly.

But if you have a second, internal drive, then moving pagefile.sys is very easy.

Moving pagefile.sys

Right click on “My Computer“, or the “Computer” item in your start menu and click on properties.

In Windows 7 click on the Advanced system settings link.

Click on the Advanced tab.

In the box labeled “Performance”, click on the Settings button.

Click on the Advanced tab in the resulting dialog.

That long, strange sequence should have you looking at a dialog similar to this:

Windows 7 Performance Options dialog

Therein you’ll see the “Virtual memory” section showing how much space has been set aside for your paging files.

Click on Change…

Virtual Memory Settings in Windows 7

As you can see, the default is to have the system manage your paging file size for you, and in my case it’s placed the entire file on my C: drive.

To change that:

  • uncheck the “Automatically manage paging file size for all drives” setting (Win 7).
  • click on the drive you want to move pagefile.sys to
  • click on System Managed Size
  • click Set
  • click on the drive currently holding pagefile.sys (probably C:)
  • click on No paging file
  • click Set
  • click on OK

Here’s mine after the change:

Virtual Memory Settings in Windows 7 after the change

You may need to reboot for the changes to take effect, but that’s all there is to it. After the changes above and a reboot pagefile.sys was removed from C: and appeared on D:.

Some notes about the choices made above:

  • “System Managed Size” is appropriate, unless you have a specific reason to need it to be otherwise. Most people do not.
  • Of the drives that showed as available on my machine only C: and D: were appropriate locations for the paging file. B: is USB drive, and F: and P: are both TrueCrypt volumes. Only C: and D: are real internal and separate drives.
  • If only C: is listed on your machine, then you have nowhere to move your paging file to. You can run without virtual memory if you like – but depending on how you use your computer you may run into out of memory situations much sooner.

Be it for performance or for disk space, moving pagefile.sys is pretty easy.


  1. Mark Jacobs

    You mentioned that system managed size is appropriate. I set mine manually to 3gb because it seems to mee that the dynamic allocation of page file size could cause an occasional slowdown. Is this true or does dynamic allocation not slow things down?

    If dynamic allocation happens at all it’s extremely infrequent and only if actually needed. You’ll note my pagefile.sys was set to my memory size (8gig). And yet my machine has NEVER needed to use any appreciable amount of VM. Let the system manage it – it’s actually pretty good about it.


  2. Pat B

    How do I know if my (D) drive is an actual separate drive or just partitioned from the C Drive? It says “Factory Image” and only has 1.54 GB free of 11.2 GB. If it is a 2nd drive, would the size be adequate if I moved pagefile.sys to that drive?. Thanks

    Fire up the disk manager (Right click on My Computer, click Manage and then click on Disk Mangement). It’ll show you which partitions live on which physical drives.


  3. Daniel J. Smelko

    I tried moving the paging file on my computer, I have windows vista home premium sp 2. it didn’t work the way it works for windows 7. When I restarted my computer and checked to see if it worked it showed none for all drives instead of “managed system” on the external drive I selected.

    External Drive? Don’t do that. It’ll just slow down your system. I’ll bet that Windows simply prevented that from happening. (My guess is that at boot time it tries to set up the page file before external drives have been detected.)


  4. Norman

    It works fine in XP with SP3 however, the display is slightly different than Win7; instead of “managed system” it displays the “Page file size” i.e. the amount of MBs you want, which in my case is the maximum 3070mb by clicking/using the “Custom Size” option.

  5. Harrytherag

    I have two 300Gb hard drives set in a striped raid array and partitioned C – F so is there any point moving the swap file to F as it’s not really on another hard drive?



  6. Seth Mootchnik

    I tried this on my Win 7 (64 bit).
    The page file did show up on my secondary internal drive, along with a duplicate (the other being on my Desktop) Recycle bin.
    However,after the reboot I got an error- that my system created a temporary paging file on the C drive.

    Any suggestions?

  7. Douglas Gross

    Just an extra note, you can look up the speed of each internal drive you have. If your C drive is faster, keep it on the C drive. If your other internal drive is faster, of course you would want to use that one. Also, it is good to set up Windows to clear the paging file when it shuts down, but that is another discussion entirely that perhaps could be the making of another article here. Also, if you have a lot of RAM and a good processor, turning the paging file off is your best option option. DO NOT turn off the paging file on an older computer with very little RAM or slower processor. Also, decreasing the paging file on an older or slower computer may force Windows to increase the paging file when you reboot, and that means you will be staring at a screen for a very long time before you get into Windows again. That is because when Windows has to increase the paging file itself it takes its sweet time.

  8. Robert DiGrazia

    I have two page files, on different disks, C and G.
    I want Windows (XP Home) to prefer the file on G:, i.e. to use the file on C: only if the file on G: fills up.
    Is there a way to tell Windows which file to prefer?

  9. Douglas Gross


    Been reading about this more and found this on Microsoft’s site:

    The optimal solution is to create one paging file that is stored on the boot partition, and then create one paging file on another partition that is less frequently accessed on a different physical hard disk if a different physical hard disk is available. Additionally, it is optimal to create the second paging file so that it exists on its own partition, with no data or operating-system-specific files. By design, Windows uses the paging file on the less frequently accessed partition over the paging file on the more heavily accessed boot partition. An internal algorithm is used to determine which paging file to use for virtual memory management.

  10. Digital Artist

    Great technique for improving performance. For XP users like me, the clicks to do this are: Start;control panel;system;advanced;performance settings;advanced; and from there the rest is described in the article. I do a lot of photo manipulation on large images which are usually saved as bitmap (bmp) files, and frequently get windows messages saying that I do not have enough virtual memory. Well, I got enough now! Thanks, Leo!

  11. Rocco

    That was awesome Leo. It worked perfect.
    I have two drives: C is SSD Vertex 2 : 60 GB and second drive WD 1TGB with two partitions D: 800GB and G: 200GB. I have i7 2600K intel processor on Asus p8p67 and 8 GB memory on the machine I just build two days ago. SSD got filled so quick, just with programs, and i had left only 9.23 GB. After moving pagefiles I am back to 17GB free space. Thank you for your contribution.

  12. JF

    Ok. I wanted to remove my pagefile from C: and stick it on D:. The result after having followed your instructions is that now I have TWO pagefiles. My D: now has a 14 GB, system managed pagefile and C: still has a 12 GB pagefile.sys file on it even thought the virtual memory dialogue shows C: as having “None”. (I have 16 GB RAM). And of course I can’t delete that leftover file on C: . Any ideas on how I get rid of it ?

  13. Chris

    After moving from C-drive to D-drive and rebooting, I still had to manually remove the old pagefile.sys on the C-drive.

  14. Uffe

    I can’t help myself… The question of the topic, “What is pagefile.sys and can I move it?” sounds a little like “Who is general failure and what is he doing on my harddisk?”

  15. keno28

    At first I thought this article would show me how to move the pagefile.sys to a different directory but it doesn’t. So it begs for a question:

    I have a dual boot PC. Can Windows 7 share the same pagefile.sys file with Windows Vista on the same drive? Thanks!

  16. Kim

    Hi Leo,

    Just wanted to say a big THANK YOU for this article! My SSD drive space has been steadily dwindling and I wasn’t sure what I could do to remedy this. But I found your article & by following your detailed instructions, it helped me free up the space taken up by the pagefile.sys. Hooray!! :)


  17. Steve


    Thanks for this and your other great articles. You really have a gift for writing with clarity and structuring your comments in a way that the information can easily be understood and followed.

    I carefully followed your bulleted steps and was able to Set the drive (F:) on which I want the pagefile.sys to reside to System Managed Size. However, after selecting its current location (C:) and clicking No Paging File, when I then clicked the Set button, I got a System Properties pop-up saying:

    “If you disable the paging file or set the initial size to less than 800 MB and a system error occurs, Windows might not record details that could help identify the problem. Do you want to continue?”

    Not having seen mention of that pop-up in your instructions, I felt it prudent to ask about it before proceeding.

    Thanks again,

    My specs FYI:

    •Processor: AMD Phenom(tm) II X6 1090T Processor 3.20 GHz
    •Memory: 16.0 GB
    •Operating System: Windows 7 Ultimate (64-bit)
    •Drive C: Crucial 128GB SATA 6.0Gbps/2.5-inch Solid State Drive (CTFDDAC128MAG-1G1)
    •Drive D: LG 12x SATA Blu-ray Writer Drive (WH12LS30K)
    •Drive E: WD 500GB SATA 6.0Gbps/7200RPM/16MB/3.5-inch Internal HD (WD5000AAKX-001CA0)
    •Drive F: Hitachi 1TB SATA 3.0Gbps/7200RPM/32MB/3.5-inch Internal HD (HDS721010CLA332)
    •Drive G: Seagate 3TB SATA 6.0Gbps/7200RPM/64MB/3.5-inch Internal HD (ST3000DM001-9YN166)
    •Drive J: WD 1TB USB 300Mbps/7200RPM/16MB External HD (WD 10EACS)
    •Drive L: Seagate 300MB USB 100Mbps/7200RPM/8MB External HD (ST330083 1A)
    •Video: ATI Radeon HD 5700 Series

    Make certain that F: is set to have a paging file, and this warning can be ignored.

  18. Steve

    Thanks for the reply Leo.

    After completing the steps and restarting my computer, I discovered in Windows Explorer that the amount of free space on my C drive had not changed. It still showed 18.5 GB free of 119 GB which is what it was before trying to remove the pagefile.sys file.

    I went back into the Virtual Memory settings (C: > Properties > Advanced system settings > Advanced tab > Performance:Settings > Advanced tab > Virtual memory:Change > Virtual Memory settings) where I found that the “Paging file size for each drive” settings were as I had left them. In other words:

    C: None
    E: None
    F: System managed
    G: None

    I cannot see the pagefile.sys file in Windows Explorer so I used TreeSize Free to examine the folders and files in the above drives. I found the following:

    C:[Files]pagefile.sys — present (16.4 GB)
    E: (none)
    F:[Files]pagefile.sys — present (16.4 GB)
    G: (none)

    So that explains why no additional space has been freed up on Drive C but I don’t understand how/why the file is still present on Drive C, since it displays “None” in the Virtual Memory settings.

    Many thanks.

  19. Samuel Pelegrini


    Please, I have a doubt and I think you can help me:

    I tried to manage my pagefile of my XP to the drive D, I have C and D. But, after the reboot, I noticed that my drive D had even less space than before and there are two pagefile on my partitioned HD, one on C and the other on D, and then I turned it back to the way it was, on C, but the pagefile on D is still there, occupying 1,44GB there. Could I delete it or do my HD need two pagefiles? That second pagefile on D was not to be there, right? What can I do now? If you can help me with this, mate, I thank you in advance.


    YOu can delete the pagefiles that are not in use. If Windows is actually using it then the delete will fail.

  20. Carlos Biscione

    Hi, Leo.

    Admirable how clear and clever responses you post. thanks for the passion.

    On my office laptop i have just one disk.

    The it guys as a policy install McAfee Antivirus(tm) and lots of things and on top of that McAfee End Point encription(tm), and on top of that the policies for the antivirus may not changed and those keep all day slowing down the computer with scans that never end and restart from scratch if i reboot.

    So in two words, the antivirus keeps running all day and the encrypter keeps encrypting everything that is written to the disk and decrypting everything read from the disk.

    I know how to counter-fight some things. One that i know to work is to keep pagefile.sys at (sufficient) fixed size (1,5 times the size for RAM when it’s bigger than 2GB) and near the start of the disk.

    This avoids it from fragmentation and speed up writes and reads of VM. With Defraggler i defragment my disk and send all the files smaller than 5MB to the end of the file. Then i erase the pagefile.sys file and recreate.

    Then defragment again specifying that large files (375MB) stay at the end of the disk while smaller ones return back to the beginning of the disk, but —after— the pagefile.sys file :)

    This basically will rise up the position of this special file in the disk. But dumb Windows XP now is not creating a file with the size i need (instead much more smaller) and is putting it near the middle of the disk.

    After all this explanation, my question is: How may i move the pagefile.sys to the beginning of the free space on the disk without reinstall Windows?. Using a second a second disk is not an option. The Microsoft(tm) Pagedefrag utility does not help too much if the file is not fragmented.

    Thanks in advance.

  21. Ian Forrest

    The pagefile.sys file is similar to the older windows operating swap file. These always helped your computer to run faster if they were placed in a small seperate partition. The pagefile.sys does a similar job but a bit more sophisticated. Personally I never have any problems with my xp system and leave it to the XP system to create and handle this sometimes large file.

  22. Paul

    Hi Leo,

    I trying to move pagefile.sys to D from C I got the following message from Windows; should I be concerned?
    System Properties
    If you disable the paging file or set the initial size to less than 200 megabytes and a system error occurs, Windows might not record details that could help identify the problem. Do you want to continue?
    Yes No

    Thanks, Paul

  23. George Melendez

    Hi Leo,

    Thanks so much for the info on the ‘virtual memory’ (page files) you offered and I did what you said and my PC is running just GREAT. Now I understand the importance of these files and why it can be beneficial to have them stored on an alternative drive other than ‘C’. That way my ‘C’ drive won’t get bogged down and the ‘D’ drive can take care of these files with no hassle at all. One question, are these files later stored as ‘temp files’ or does WINS 7 automatically delete them when ‘virtual memory’ is needed again? Again, thanks for your time. It is appreciated.
    George Melendez

    • No. If you have a paging file configured then it is “in use” and cannot be deleted. If you configure no paging file then you can delete the file like any other without needing a special utility.

  24. Ziyad

    Dear Leo, your article on the paging file problem really solved a huge issue for me. for days i had been downloading file trackers, killdisks etc to no avail, then i found your post. thank you ever so much.
    unfortunately i do have a problem. the reason i had been working on the paging file problem was i needed to free my d drive so i can merge with my c drive. the c drive being the main drive. the page.sys file was on the d drive and i was hoping after removing it i could format and merge with the c. i was able to format the d but the c is not giving me the option to “extend partition”. is there anyway you can help me? i moved the page.sys file to the e drive. is this affecting the process? does the page.sys file have to be on the c drive? (theres no more space on the c drive and i havent downloaded or installed anything that can free the 1.8g i need to transfer the pagesys file onto the c with.
    i bought the laptop with windows 7 already configured on it. the c drive was, oddly enough given only 25g space while the other three drives were broken into roughly 90g each. i have merged the e and f drives now making them e but the problem is with merging the c and d. c doesnt give the option i stated above.
    i am on the verge of reinstalling windows 7 but i am pretty sure this can be done without reinstalling. please help me. i hope your reply will hit my mail ad too. thanks so much for all already and in advance too.

Leave a reply:

Before commenting please:

  • Read the article. Seriously. You'd be shocked at how many people make comments that prove they didn't.
  • Comment only on the article. If you have a new, unrelated question start with the search box at the top of the page.
  • Don't post personal information. Email addresses, phone numbers and such will be removed.

VERY IMPORTANT: because of a rise in comment spam that's making it through our filters any comments that do not add to the discussion - typically off topic or content-free comments - run a very high risk of being flagged as spam and removed.

If you have a new question unrelated to the article above, ask it on the Ask Leo! ask-a-question page.

Your email address will not be published. Required fields are marked *