How can I move the page file to another physical disk location?

101

24

I would like to know exact instructions for moving the page file from 1 disk location to another disk in Windows 7. I.e. from an SSD to a non-SSD drive.

I've spent about two hours searching - Google, Bing, Blekko - and read many forums. Please don't post philosophical discussions on speed increases or why its a bad idea to disable paging.

I'm looking for a concise answer on how to move the page file.

JL.

Posted 2011-01-25T21:58:13.800

Reputation: 5 578

Did you find out how to move the C: page file? Your answers show how to resize, delete, and modify other drive files, but not what you're asking... – TechnicalTophat – 2017-01-19T08:30:39.687

Added tags. I would just clarify for anyone reading this who's confused what JL is talking about that this hasn't been, to my knowledge, called a "swap file" since Win9x - it's "page file" under Windows NT. – Shinrai – 2011-01-25T22:27:26.900

I've modified the question accordingly. – None – 2011-01-25T22:58:09.153

1@Randolph - Aww, foo, I kinda like the older nomeclature. :) – Shinrai – 2011-01-25T23:25:29.827

1

possible duplicate of Change the volume the windows page file is on

– Mokubai – 2012-05-08T21:24:38.057

Answers

110

To change page file settings in Windows 7:

In the Start Menu search box, type "Advanced System Settings" and choose the Control Panel applet that should show up, "View advanced system settings"

step1

Under "Advanced" tab, "Performance" section, click "Settings..."

enter image description here

Under "Advanced" tab, "Virtual Memory" section, click "Change..."

enter image description here

These are the actual settings.

enter image description here

Uncheck "Automatically manage paging file size for all drives" and you can change these settings. Highlight the drive you want it on, and select either a fixed size or system managed size, and then click "Set". YOU HAVE TO CLICK THE SET BUTTON. Do the same to remove it from the drive you don't want it on. ("No paging file".)

Click OK, OK, OK, and you should be prompted for a reboot.

Shinrai

Posted 2011-01-25T21:58:13.800

Reputation: 18 051

What if I don't get prompted for a reboot? – slhck – 2015-02-17T08:37:36.880

@slhck Then you probably didn't hit "Set" :-). Note that you need to choose drive, change options, hit "Set", go to another drive, choose options, hit "Set"... Actual changes as seems are made after you click OK and reboot. – Nux – 2015-03-16T18:11:16.610

You do not need a pagefile on C for minidumps. You do need one on C for kernel or full dumps (but there's a workaround for that). – Jamie Hanrahan – 2016-06-06T00:31:11.307

1I changed the location from C: to D: with your instructions. The pagefile on D: was properly created. But I still have the pagefile on C: too. Already rebooted two times. In the virtual memory settings, however, it says "None" for Paging File Size on C:. – Exa – 2016-09-02T12:34:24.843

@slhck Do you know if the OS chooses the page drive file location (given it has alternatives) based on benchmarked read-write speeds? I have allocated 4 GB in SSD and 20 in HD (much slower). I have seen pages being swapped out many times. I know 4GB limit is crossed only rarely. But I keep the 20GB for just-in-case scenarios. Would it be more prudent to just de-allocate the 20GB? I think Windows might see both 4GB and 20GB as equals (in terms of read-write speed). Thanks for your time. – Rahul – 2017-02-23T13:17:40.033

1@Rahul No idea, sorry – you may have addressed the wrong person here? – slhck – 2017-02-25T09:09:58.640

@slhck Thanks for the response. And yes, am sorry, it was wrongly addressed to you. – Rahul – 2017-02-25T19:16:07.473

I have the pagefile on C disabled (it is on an internal SSD instead) and cannot produce any minidumps whatsoever. @JamieHanrahan - what is the workaround to have a full dump on C without the pagefile located on C? - oh - I think it is to set System Failure's Write Debugging information to (none). – bgmCoder – 2017-04-26T21:25:19.407

2

@bgmCoder no - that is for the loc of the dump file, but if you don't have a pagefile on your boot partition it won't work without this: In the registry key HKLM\System\CurrentControlSet\Control\CrashControl , created a value called DedicatedDumpFile , type REG_EXPAND_SZ. Set its value to a complete path to a temporary dump file, such as D:\tmp\DumpTemp.sys . Reference: https://blogs.msdn.microsoft.com/ntdebugging/2010/04/02/how-to-use-the-dedicateddumpfile-registry-value-to-overcome-space-limitations-on-the-system-drive-when-capturing-a-system-memory-dump/

– Jamie Hanrahan – 2017-05-07T22:42:30.777

@JamieHanrahan I appreciate the reference; thank you for your time. This is good information to have in this answer. – bgmCoder – 2017-05-08T15:12:28.017

@bgmCoder You're welcome. Sorry I couldn't get to it sooner. – Jamie Hanrahan – 2017-05-08T15:56:27.007

1@Rahul When creating the file, the default pagefile location is on your boot partition (normally C:). There is no attention paid to drive performance. In operation, if you have more than one pagefile, when it's time to write something the memory manager picks the one on the drive (not partition) with the shortest average request queue length. – Jamie Hanrahan – 2017-05-08T16:03:50.173

@JamieHanrahan Thank you so much.I actually did do some testing - and my results concur with what you said.I did not know the reason, now I know.Just in case this helps - there was no noticeable difference between the pagefiles in my SSD and 5900 NAS HD.I have 12 GB RAM already, so not a lot gets paged out usually.If that happens(memory leak-proprietary database transformation software), I feel - HD is a better option because I can allocate a huge file 20 GB, so that I won't run into 'Memory not available' error. I think OS always opted HD because my SSD (OS) mostly had higher queue length. – Rahul – 2017-05-08T17:31:44.977

1@Rahul Indeed - having a large pagefile is not always "because you need to put so much stuff there", but because virtual memory allocation requires that it be available just in case that much stuff has to be put there. – Jamie Hanrahan – 2017-05-08T20:31:37.013

7Unless things have changed with Vista onwards, I think you still need a small pagefile on C: for BSOD minidumps to be made. – paradroid – 2011-01-26T01:49:12.683

@paradroid - I think you may be correct (I don't ever recall hearing that that changed) but the OP specifically requested no philosophical discussion. I personally would keep paging to the SSD if it were me! – Shinrai – 2011-01-26T15:15:30.997

1@Shinrai But the usb flash drives does not exist there . any solution for that ? – Omid Kosari – 2013-05-07T06:22:31.130

@OmidKosari - That's by design, you should not be paging to removable drives because, hey, what happens if they're removed? You can use ReadyBoost if you REALLY want something like that, but it typically doesn't help much in my experience. (I'm also not sure what this has to do with the topic at hand, which is REMOVING page files...you already should have no paging file on a flash drive.) – Shinrai – 2013-05-07T16:06:59.460

28

  • Control Panel, System
  • Advanced System Settings
  • Advanced Tab
  • Settings button under Performance
  • Advanced Tab
  • Change button under Virtual Memory

enter image description here

  • On your SSD drive, change the option to "No Paging File".
  • Click Set.
  • On your Hard Drive, set the option to either Custom Size or System Managed Size.
  • Click Set.
  • OK and reboot.

mtone

Posted 2011-01-25T21:58:13.800

Reputation: 11 230

1Comment by @whizkid: mtone's answer describes it all. When you move the page file, note that you turn off page file on a partition and turn it ON on another. (Hope you do not expect any data residing on it to be moved too, coz thats not going to happen). – Ivo Flipse – 2011-01-26T00:14:06.433

17

If you want to completely remove the pagefile from your system drive, you will need one extra step to Shinrai and mtone's answers. As a comment by paradroid mentions, Windows requires to have a pagefile present on your system drive in order to write kernel memory dumps in the event of a crash. So even if you set "No pagefile" on your system drive, Windows will end up creating a pagefile anyway, even if it doesn't actually use it for paging. Trying to delete this pagefile will show it to be in use.

In order to work around this, you have to disable kernel memory dumps, which is also done by going through the advanced system settings.

Under the "Advanced" tab, in the "Startup and Recovery" section, click "Settings..."

In the dialogue box that comes up, under the "System failure" section, and the "Write debugging information" subsection, change the drop down menu to "(none)".

After this, you should be able to delete the pagefile.sys from your system drive (although you might need to reboot first).

Camille

Posted 2011-01-25T21:58:13.800

Reputation: 304

Does this still allow the creation of minidumps from BSOD's? – bgmCoder – 2017-04-26T21:28:34.730

Although Windows will end up creating a pagefile anyway, even if it doesn't actually use it for paging may sound like "windows would prefer using pagefile on another disk, where pagefile is explicitly allowed, and only use pagefile on C in special cases", it is not like that. The pagefile on C would be used just like before. (At least in my case, on Windows7 x64). – i3v – 2017-05-10T16:53:24.173

@bgmCoder No, BSOD minidumps (i.e.: system failure) is exactly what this option disables. – Camille – 2017-07-31T14:15:11.040

6

@paranoid you are correct, You need a paging file on the OS partition; the minimum paging file size for the OS partition is 800MB (e.g.: for Win7 Ultimate 64bit). ...This could vary, but Windows will tell you if you set it under the recommended size.

  1. Follow the instructions already posted to set the paging file on the alternate drive.
  2. Then set a small paging file on the OS partition to accomodate the minidumps and BSOD:
    • If you don't set a paging file on the OS partition, every time you boot Windows will create a temp pagefile.sys the same size as your installed physical RAM.
    • So, if you have 16GB of physical RAM, the temp pagefile.sys will be created at 16,308MB (which is a decent chunk out of your System partition).

I recommend researching a bit for anyone who plans on changing paging file settings on a system where lost work could be critical.

D-Wa

Posted 2011-01-25T21:58:13.800

Reputation: 81

If saving space on the OS partition is your goal you can also eliminate the hyberfile.sys file by turning off Hybernation via CMD prompt. instructions here: Delete hyberfile from system drive and Turn Off Hybernation

– D-Wa – 2011-11-16T21:13:43.873

2

I noticed that several people may be misinterpreting the Windows recommendation and statements. The fact is, (as someone had said early in the topic), you can improve your systems performance by moving the Page File to a different physical drive.

I have 5 drives in my computer, (2 500GB SSD's and 3 1TB HDD’s), and have moved the Page File from the 500GB SSD O/S Drive, to my most "immediate" HDD media drive. That drive is the one that meant to take 95% of the programs I have installed as well as my Pics and Docs files.

Programs like Adobe Acrobat X, CS 6 Extended, On One Photo Suite 8, etc. are on that Hard Drive. I've recently added another 1 TB HDD and have now moved the Page file to the new 1TB drive thereby making it just that much easier on the entire process.

The point is to keep the Page File partition but move it to a drive that doesn't have to run often. I can’t say how much work the system does when dealing with Page File data, but every little bit helps. Rich

Rich Paul

Posted 2011-01-25T21:58:13.800

Reputation: 21

1I use Intel Rapid Storage Technology's disk acceleration, utilizing an internal SSD drive - since it only takes half the space on the 119GB SSD, I use the other half for my system's pagefile. – bgmCoder – 2017-04-26T21:30:32.510

I have exactly the same set up as @bgmCoder, except of I have also a smaller pagefile on the system drive, so Windows is able to make kernel dumps. – Dawid Ferenczy Rogožan – 2017-09-06T16:50:18.110