System Tweaking Guide - Virtual Memory - By Mark "Frugal" Bush
Why not let Windows
handle Virtual Memory. Dynamic vs static swap file. When Windows
manages the swap file it needs to constantly resize it. This leads
to a performance hit. This performance hit is not that big a factor
these days as the speed of cpu's and hard drives is such that
the hit is minimal.
Should we have a static swap, or dynamic, if static what size should it be, where should
it live and how do we set it up. These days I would opt for a semi dynamic swap, that is to say I set a minimum but no maximum size.
As far as size is concerned the
old axim used to be "twice your physical ram plus 10%". I don't
beleive this applies anymore as when this was determined the average
user had 16mb and few apps needed more than 32mb. Also this formula
falls down because the less memory you have the larger the swap
required, yet this formula assigns more swap the more memory you
have.
Today 256mb is becoming entry level and most games are memory
hungry. Personally I have found 250 mb to be optimum minimum
swap size regardless of physical ram. As far as the maximum
is concerned I would reccomend setting that to around 850 because some modern games require a large swap. I reccomend a 250 MB minimum as I have
found absolutely no performance gain with a minimum size below
250 MB but above 256 MB a performance loss is quite common in many games. One thing worth noting at this point is that if your free hard drive space drops below your maximum swap size Windows will start to manage the swap file and performance may drop. So it is important to make sure that you will still have plenty of room on the drive even if the swap grows to its maximum size. It is because of the performance loss above 256mb that I do not reccomend a static swap file of 600 MB like some people are at the moment. If you look through our forums you will see that this performance loss with a swap above 256MB has been confirmed many times by people with Falcon 4.
With a minimum of 250 you will minimise the fragmentation as
the swap will rarely have to resize. The reason I reccomend
setting the maximum to around 850 is because
more and more games are becoming memory hungry. B17 2 requires
a swap file around 400 MB and this will become more common in
the future, if your swapfile cannot grow to at least 400 meg you may have problems with some of todays games.
You could use the System Monitor to track your swap
file size in order to determine a minimum more suited to your
general use of your PC but to be honest the only thing you are
likely to gain is a small amount of disk space.
As to where should it live, this depends on how many hard drives
you have. I mean real HD's not partitions. If you have more than
one hd then you should put your swap on a different HD to your
games, preferably on its own partition. This way both the swap
and your game files can be accessed simultaniously (assuming you have scsi drives). It is also
worth noting that you should avoid putting 2 hard drives on the
same IDE channel.
Whilst more than one IDE drive will not be accessed simultaniously there are a couple of gains to be made by having the
swap on a separate drive with IDE, the main one being head travel. If
game files need to be written to the swap on drive with the game and the
swap on the same drive (or a separate partition of the same drive) the
heads will have to move away from the game files to the swap file
and then back, or more realistically back and forth between the 2.
If the swap is on a separate drive and both the swap and the game textures/files
need to be accessed, the heads will remain with the game files on
1 drive while the other drive accesses the swap. Whilst only one drive is
likely to be active at any one time there will be no unnecessary
movement of the heads. On todays very fast drives this can almost be as
quick as the 2 drives being accessed simultaneously.
If you have only 1 HD then the swap file should be ideally be
placed at the outer edge of your drive if you have any software
that will do this although realistically the performance gains
for doing this are not worth the extra trouble.
To set up virtual memory right click on "My Computer" then select
"Performance". Select "Virtual Memory". Select "Let me specify
my own virtual memory settings". Make sure the correct drive
is selected then set the Min to 250MB, the max should already
be set to the available space. After confirming that you wish
to do this you will be prompted to re-boot.
Once windows is up again you will be the proud owner of a semi
static swap file :o) All that now remains is to defrag the drive
to keep everything tidy, click on "Start" Select "Run" type
"defrag" without the quotes. Hit return and select the correct
drive then ok.
One other thing that may give you a performance boost is to add the line
ConservativeSwapfileUsage=1
to the [386Enh] section of the System.ini (make a back up of this file before making changes to it). Many people think that this tells windows to use all physical mem before using the swap file. This is not actually true, Windows 98 added a new feature, PageFile_Call_Async_Manager, that allows the Memory Manager to asynchronously write out page file (swap file) buffers during periods of time when VFAT file system activity is not busy. ConservativeSwapfileUsage=1 disables this feature, causing the system to behave as Windows 95 does (at some cost in overall system performance according to Microsoft). Here is Microsofts description on their Knowledge Base. Many people have reported a performance increase with this setting so it is worth giving it a try even though MS say it will cause a performance hit.
Once you are happy with your Virtual Memory settings you will be ready to move on to the next tweak.
random irc quote: <DrFreud> care to talk about it? <eRAZOR> haha <DrFreud> we were discussing you, not me <eRAZOR> back off psycho <DrFreud> Care to elaborate?