Swap file size

zzoo

Distinguished
Aug 9, 2006
17
0
18,510
When we upgrade the memory, should we decrease the swap file to gain more speed ? If I have 2GB of RAM, what's the ideal swap file size ?
Thank you
 

LoneEagle

Distinguished
Oct 19, 2006
451
0
18,810
Do you have XP or Vista?
Vista use more memory so may need more virtual.
Do you play games?

With XP, I tried to reduce it but like below 1GB but was running into problems with my BF2142 game. So I returned to managed by OS.

Now I have Vista and 2GB and waiting for my 2 other. With 4 GB, I will do more testing and try to reduce a lot or even eliminate that slow memory.

I believe some app are programmed to use virtual so not having it will crash the app. To be confirmed by someone else...

To best is to reduce it gradually until your system start crashing.
 

LoneEagle

Distinguished
Oct 19, 2006
451
0
18,810
Yup.

Me, I upgraded from Vista 32 to Vista 64 and look better. I can't wait to get my 2 extra GB! Then I will put it below 1GB. For now, I let Vista manage it.
 
Virtual memory is only used when you run out of RAM or the program "forces" a write to virtual memory or temp files. Having more than you need means nothing unless you are short on disk space. More important is where it is. On a new system it gets placed right after the OS but it tends to get pushed to the inner edge of the disk as time goes on because it get recreated on every boot.

To get the best performance, you'll want to keep it as close to the outer edge of the hard drive as possible and, if possible, on a second Hard Drive. So when adding a 2nd Hard drive to your non RAID system, the best thing you can do is create a small 4-8 Gig Partition (let's call it D:\) right at the beginning of the new HD. Change the virtual memory location then from C to D and set the minimum and maximum to the same size (say 2048 MB). HD's move data at about twice the rate on the outer edge as they do on the inner edge so you are now permanently insured that it is at the fastest possible location.

While you are at it, might as well reset the environment variable so that temp files are also set to utilize the D partition. Next to the swap file, these are the files most accessed by windows.Since both the swap and temp files are "temporary" files, you will gain not advantage from the file protections offered NTFS and can go with the speedier (especially with large files) FAT32 for the D Partition. This makes housekeeping easy also as it's very easy to find and delete temp files. With the min and max page file fixed, and the rest of the D partition regularly cleaned, fragmentation of the page file will never be an issue.

On a single drive or RAID system, simply place the D partition right behind a small 8 - 16 GB OS partition (C:\). Then behind ya D partition, allocate E:\ for the thing you want to go the fastest (probably Games), then F:\ for Programs, G:\for Data and maybe H:| for backups.

In this manner you will optimize your use of the hard drive such that the fastest parts of the HD are reserved for what you need to go the fastest.
 

LoneEagle

Distinguished
Oct 19, 2006
451
0
18,810
To OP,

For your information, I installed my 2 extra GB for a total of 4 and I reduced to 512 MB my swap file. I tried to disable it but Vista gave me a warning that the minium should be 200 MB in case of crash or whatever. So I choosed 512. Please note that I upgraded from Vista 32 to 64 bits.

I play Battlefield 2142 and work like a charm. When I quit, I get back the controle of my machine very fast. Before was a long delay of swapping

NO MORE SWAPPING!!! YESSSS!!! :)

I paid 123$CAD and really worth it. RAM prices are good. Cheap way to upgrade the speed of your computer.

JackNaylor PE: Great tips and good solution but I really prefer to simply install more RAM! :).

Question to OP: Can you post your result? What was the size you could set before getting into problems? If you have Vista 32, may be you can had 2 512Mb of RAM for 3GB?