# Virtual Memory Setting and Ram Upgrade



## tmounk (Oct 5, 2006)

I recently upgraded my ram to 2GB, now the recomended virtual setting is higher than before. I heard that you should multiplye the amount of ram by 150%. That would be 3000 for 2gb, but I didn't noticed a big difference so I switched it back. But now the original settings is for 1GB and the recommended setting is around 3000. Should I set both min and high settings the same at around 3000 or leave it at the 1GB setting.


----------



## UncleMacro (Jan 26, 2005)

If you have more physical RAM in your system and you're running the same programs as before then you're not going to need virtual memory as much. That's the point of having more RAM: to avoid accessing the slower virtual memory which is stored in the page file on your hard disk. If you got more RAM to run ever larger programs then it would be a good idea to increase the size of your virtual memory. But if you're just running the same old programs then there's no point in doing it.

That being said, if you have lots of free disk space (most people do these days) then you can just set your virtual memory to a big number like 3 or 4 gig. If you set both the minimum and maximum to 4 gig then Windows won't waste time expanding or contracting the page file. If the minimum is smaller than the maximum then Windows can expand or contract the page file whenever something large is allocated or deallocated.That can get annoying because it involves a lot of disk accesses and whatever program is running at the time slows down a lot. By setting the minimum and maximum to the same size, that amount of disk space is permanently allocated to your page file. You only do it if you have the extra disk space. Gamers normally do this because Windows can decide to change the size of the page file while playing a game and, of course, the game gets very choppy while that happens.

If you've got the extra disk space to dedicate 3 gig to the page file then I'd just set both the minimum and maximum to 3 gig and then ignore it. That's enough to run just about any hog of a program and most folks have an extra 3 gig laying around anyway. If you're really short on disk space then you can stick with a small minimum and a larger maximum but you'll have to tolerate the occasional annoying adjustment in the size of the page file whenever something large is allocated or deallocated.


----------



## tmounk (Oct 5, 2006)

I've tried matching the min and max settings at 3GB, but for some reason it is a little slower than the original setting at 1524 and 3048. The recommended is 3057. I'm going to try the 3GB on both settings and see if their is any difference. By the way what setting do you have your computer on and how much memory do you have?


----------



## UncleMacro (Jan 26, 2005)

Microsoft's position on the subject is:



> How to manually manage computer memory
> When your computer is running low on RAM, and you must have more RAM immediately, Windows uses hard disk space to simulate RAM. This is known as virtual memory. It is also known as the paging file. This is similar to the UNIX swapfile. By default, the virtual memory paging file (named pagefile.sys) that is created during installation is 1.5 times the RAM on your computer.
> 
> You can optimize virtual memory use by dividing the space between multiple drives and by removing space from slow or heavily accessed drives. To best optimize your virtual memory space, divide it among as many physical hard drives as possible. When you select drives, follow these guidelines:
> ...


They basically want the page file not to be on the same drive as the system files and programs which may have to be swapped. The point is that the head on the system disk drive is jumping around accessing system files and programs and DLLs that you're running and then the swap file is on a separate drive (or drives) where the head is just moving around in your swap file and not being used for much of anything else. If you put the swap file on a busy drive then the head on that drive has to seek back and forth between its other duties and the swap file. Of course, this solution only helps you if you have more than one disk drive and one or more of your other drives isn't being accessed very much. If you only have one drive or all of your drives are being accessed a lot (usually a RAID system) then this doesn't help you.

I have 2 GB of RAM and my swap file min and max are set at 3GB. I haven't been as diligent as you when it comes to trying to figure out if different swap file sizes affect the performance. I just set it once and have ignored it since. The "set the min and max to the same size" trick is well known so I did that. The one other thing which can cause some performance trouble is if your swap file is seriously fragmented.

My pagefile has only one fragment and since it never changes sizes I don't have to worry about it ever being fragmented. I think there are some programs which can defrag your swap file but the default Windows defragger doesn't do it. The way I got my swap file to be a single fragment was by creating it right after I installed XP. But I'm not in the optimal situation because it's on my C drive with the system files and programs. I have multiple drives but I didn't want it on the D drive because sometimes it's disconnected and XP isn't happy if you try to boot it with no swap file.

This page is a bit technical but it looks to be well researched (he consulted a guy who's written well regarded books about Windows OS internals). About the only thing different he tells you to do is to set your minimum to a high value like 3G and then set the maximum to an extremely high value in case you ever need it. If you never need the extra page file space then that would run at the same speed as min and max set to 3G.


----------

