Using a partition for your swap file

  • warning: fopen(local_112747.xml) [function.fopen]: failed to open stream: Permission denied in E:\sites\windvis.com\includes\common.inc(1342) : eval()'d code on line 40.
  • warning: fopen(local_112747.xml) [function.fopen]: failed to open stream: Permission denied in E:\sites\windvis.com\includes\common.inc(1342) : eval()'d code on line 47.

Creating a separate partition for the swap file and modifying the setting for virtual memory will increase your overall computer performance.

What is virtual memory?

To make things simple, virtual memory is a "necessary evil" present in Microsoft's Windows since Windows 3.0, back in 1990, and all that you need to know without getting a headache is that a file on your hard drive is used to store data. This file is called a "swap file" or a "page file".

The swap file is a temporary file created by your operating system to keep data for later use, and in some situations a well configured virtual memory can increase your computer performance

Do I really need to change virtual memory settings?

Nobody says that you have to do this, but you'll surely notice the performance improvement after you do it! Just one more thing - be sure that you don't disable the virtual memory on all your partitions, no matter how much memory your computer has, because this may lead to some problems that you don't want to have.

Create a partition for your swap file

First, create a partition. The recommended size for the new partition is 2.5 times your RAM size plus 500 Mb(eg: if you have 1GB of RAM the partition should have 3 GB)

When slicing your hard drive to create the swap partition, be sure to place it as close to the first one as possible, because transfer speeds are lower as you go towards the last sectors of the drive.

Modify virtual memory settings


  • Click on Start -> Control Panel -> System and Maintenance -> System
  • Choose Advanced system settings from the top left hands side
  • Make sure that the Advanced tab is selected
  • In the Performance section click Settings
  • Click on the Advanced tab
  • In the Virtual Memory section click Change

Now, before being able to change any virtual memory setting, you have to uncheck "Automatically manage paging file sizes for all drives".

Note: be careful to disable the use of the swap files on other partitions (if you don't, Windows will place a swap file on your first partition too). To do this, select a partition, check "No paging file" and click Set

Click on the partition you want to use as a swap partition, select Custom Size, and set the new sizes of your swap file. The recommended size is 2.5 times your RAM size, and my choice is to set the Initial Size and Maximum Size values equal, to get a fixed size swap file.

After restarting your computer, the virtual memory used by your Vista will take advantage of its own partition, so the swap file won't become fragmented, and your system will run better than before. Just try to do this and share with us your results, we'll be glad to assist you with every problem that you will encounter!

Related articles:

Your idea is largely correct

Your idea is largely correct but creating a whole new partition is pretty overkill.

I suggest that people setup a fixed swap file on their c:\ drive and then move it to the front of the drive using a 3rd party defragmentation program so it can be accessed quickly and it's stored in 1 block


You can probably go that way

You can probably go that way too. But you need a 3rd party defrag software, as you said.


this helped because now i

this helped because now i finally know what to set the paging size to
but i do have a question on a game when i go to run it it tells me that windows swap file is disbled and to enable it and try again my paging is activated and set to the size you suggested but it still gives me the message although it runs without it it is extremly slow and shouldnt be with my system can you give me any advice on fixing this


Hey Yannie, What game are

Hey Yannie,
What game are you playing?
Can you send me a screenshoot with the error you are getting?

Great post, thanks. By the

Great post, thanks.
By the way, how can I move swap file to the front of the disk? What 3rd party apps to use? I would appreciate any answer ;)


Well.. with 2.5gigs of RAM I

Well.. with 2.5gigs of RAM I have the swap file disabled and Vista runs very well indeed...


Settings don't stick

Hi there! Great website, and thanks for your help with this. I've just purchased a new HP Pavilion PC a6020a that comes standard with 512MB RAM and Vista Home Basic. I'm a little click-happy (read: impatient) and find the RAM to be rather limiting, so I tried your 'Using a partition for your swap file' suggestion, but find that the settings after a reboot don't stick. Can you help me?

Following your instructions to the letter above and basing caculations on the installed 512MB RAM, I created a 2GB (2048MB) partition as B:\, set the default system disk (C:\) to 'No paging file' and my new B:\ with a Custom Paging File Size with an Initial and Maxium of 1280MB (512MB x 2.5). I then OK my way out and can see in Windows Task Manager that the page file now sits at around 900MB / 2773MB and the Phyical Memory seems to be resting easier (around 370-400MB instead of 500MB) and all is fine until I reboot the computer and note that the Page File has returned to it's original size and my Virtual Memory settings are sitting at 'No Page File' across all drives.

Any suggestions?


Sometimes you really need more than just "optimization"

First of all, if you're really a "click happy" person, I have to give you an advice that may not sound what you're waiting for, but is the best in this situation: get at least 512 more memory. No matter what kind of optimization you perform on your system, 512 in Vista is not enough, unless you want to open the computer and look at the desktop...

Now, next thing to do is to change the letter asigned to the swap partition, let's say E, F or whatever. B used to be reserved for ancient 5.25" disks, and I think this may be the problem, although I am not sure. Once you do that and restart your computer, we'll set the swap again. Follow the next steps...

1. Click the following Start Orb>Control Panel>System>Advanced System Settings
2. In the Advanced tab... read the article above again, it's exactly the same process.

At last, be sure to press Set each time you change the swap settings for a partition, and OK when you finished with all of them. Two more OK clicks and then restart. I hope the B drive letter was the problem and this solves the problem, because if this is not the case...then it is possible to have a really interesting problem here.

Good luck!


Hide partition

Very good post.

Just one question:
Is it possible to hide the swap partition in Vista, instead of assiging it a drive letter?
I was told that some laptops have their recovery software in a hidden partition, does this work for swap too?
If yes...how can it be done?

thanks.


Low Disk Space message

I have 3 gigs of ram, so I made my swap partition (s:) ~7.5 gigs; 7792 mb after formatting. When I go to set the virtual memory initial size and max size to 7792 mb, vista tells me that I have to leave at least 5 mb of free space for the partition, so, I adjust both initial and max to be 7787 mb. After rebooting, I start getting the Low Disk Space message popping up from the system tray telling me that the swap drive (s:) is running out of space.

Is there some way to prevent vista from giving me this message, or somehow treat the swap drive differently than other data partitions? Is it possible to hide the swap drive and still tell vista to use it for virtual memory?

Thank you very much for your useful article!


Leave the partition at 7.5

Leave the partition at 7.5 gigs but when you change the swap file settings, just put 8 gigs for Custom Size.


Partition (Drive) is too small for paging file specified

As expected, when I try to allocate an 8 gig paging file in a partition that is only 7.5 gigs, the system tells me that the partition (drive) is too small for the maximum paging file size I am specifying. Any combination I use with the initial/maximum sizes, if I try to allocate more than 7.5 gigs it gives me the error, which seems logical.

Could you please be a bit more specific with your suggestion?

Thanks again.


Sorry, I don't know why I've

Sorry, I don't know why I've told you 8 gigs...
Try 7 GB for initial/maximum sizes and if you start getting the Low Disk Space try putting 6.5 GB


Reason that the "Settings don't stick"

>>Following your instructions to the letter above and basing caculations on the installed 512MB RAM, I created a 2GB (2048MB) partition as B:\, set the default system disk (C:\) to 'No paging file' and my new B:\ with a Custom Paging File Size ... <<

A: and B: are reserved for your 1st and 2nd floppy drives respectively. You can't use those letters for hard drives.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options