📄 virtual memory optimization guide rev. 4.0 - final.txt
字号:
No one can tell you how much hard disk space you need to allocate to a permanent paging file because every system is different and everyone uses his/her system differently.
If you create a permanent paging file that is too small, then Windows will continuously create more virtual memory via a dynamic extension to the permanent paging file. This reduces the paging file's performance
If you create a permanent paging file that is too large, you are only wasting hard disk space, especially on the outer tracks.
So, the best method would be to accurately gauge how much virtual memory you actually need. This allows you to create a permanent paging file with the appropriate size. To do that, you need to monitor your paging file usage. Let's see how you can do that.
Finding Out In Windows 9x
Give your system a clean boot and once you are in Windows 95/98, load System Monitor. You can get to it via Start Menu > Programs > Accessories > System Tools. You will see this screen :-
Go to the Edit menu and click on Add Item...
In the next screen, select the Memory Manager category and add Swapfile in use. Click OK and you will see this screen :-
Now, you can monitor the size of your paging file. Start up and run all the applications that you usually use at the same time. Load several documents and work files. Play around with them and check the peak value for the paging file.
Then play several of the most memory-intensive games you have. 3D games with large textures are good ones to test. At all times, record down the highest value for the paging file size that System Monitor reports.
Once you are done, select the highest value that has been recorded for the paging file size and round it up to the nearest 100MB. For example, if the biggest size your paging file ever went during the tests was 619MB, then 700MB is the ideal size for your paging file.
But always make sure you add at least 40-50MB as a cushion against future memory-guzzling applications or games. For example, if the largest size your paging file expanded to during your tests was 684MB, then 750MB would be an ideal size for your paging file.
How Much Virtual Memory Do I Need?
Finding Out In Windows XP
Finding your optimal paging file size in Windows XP is much easier.
Just give your system a clean boot. Once you are in Windows XP, run Task Manager . You can get to it by right-clicking on the taskbar and selecting Task Manager. You can also access it through the keyboard shortcut of Ctrl-Alt-Del.
After you load Task Manager, click on the Performance tab. You will see this screen :-
Now, you can monitor the size of your paging file. Start up and run all the applications that you usually use at the same time. Load several documents and work files. Play around with them and check the peak value for the paging file.
Then play several of the most memory-intensive games you have. 3D games with large textures are good ones to test. At all times, record down the highest value for the paging file size that System Monitor reports.
Once you are done, select the highest value that has been recorded for the paging file size and round it up to the nearest 100MB. For example, if the biggest size your paging file ever went during the tests was 619MB, then 700MB is the ideal size for your paging file.
But always make sure you add at least 40-50MB as a cushion against future memory-guzzling applications or games. For example, if the largest size your paging file expanded to during your tests was 684MB, then 750MB would be an ideal size for your paging file.
Moving The Paging File To A Different Partition
Another popular technique proposed by many tweakers suggests moving a temporary paging file from the default first partition to a separate, dedicated partition.
The reasons for this technique are ostensibly two-fold :-
+ to reduce fragmentation of the first partition
+ to ensure that the paging file will remain contiguous even though it is a temporary paging file
This idea looks good because it enables users of temporary paging files to keep their primary partition neat and the paging file contiguous for a speed boost.
However, many users of this technique failed to take into account several things. Let's see what they are.
Cylinders And Partitions
First of all, let's take a look at a hard disk cylinder. A cylinder consists of the same tracks on all the platters in the hard disk.
The first cylinder, nominally called cylinder 0, is coloured in bright green. It is the outer most cylinder and consists of the first track of all the platters in the hard disk. Such groups of tracks have a cylindrical look, hence the name. Cylinder n (in red) is the last cylinder of the hard disk, where n can be any integer.
Partitions are constructed using full cylinders. The first one starts at cylinder 0 and go out to where you specify. The next one starts on the following cylinder, and so on. If you try to create a partition with an end that falls in the middle of the cylinder, FDISK or similar utilities will round it up so that the partition occupies the entire cylinder, instead of a partial cylinder.
Needless to say, the first partition will always start with the first track of every platter. In other words, the first partition will always be the fastest partition in the hard disk, followed by the second partition and so on. Therefore, if you create a second partition and dump the paging file there, you will actually be moving it to a slower part of your hard disk!
As you can see, while the temporary paging file will be remain contiguous using this technique, the transfer of the paging file from the outer tracks to the inner tracks of the hard disk will inevitably reduce its performance.
Need More Reasons?
Creating a dedicated partition for the dynamic paging file also means tying up hard disk space and inviting inflexibility.
Users of FDISK will find it impossible to change the size of the paging file partition when they need to do so. In fact, they will have to remove at least two partitions to create a larger one. If they only have one primary and a secondary paging file partition, then they will have to remove both and recreate two new partitions.
Users of special utilities like Partition Magic will have an easier time as they can easily adjust the sizes of the partitions. But in the end, this method is counter-productive because for all your trouble, you have just slowed down your paging file and orphaned off a portion of your hard disk for the dedicated partition.
The main reason for using a temporary paging file is actually to save hard disk space. Users of a temporary paging file avoid tying up large amounts of hard disk space in a permanent swapfile.
However, this method actually requires you to set aside a large amount of hard disk space and worse, place cordon off this space in an inflexible partition. If you can afford to allocate space for this dedicated partition, you would be better off using the space for a permanent paging file.
In my opinion, this technique is a waste of time and needlessly endangers your data. Messing around with FDISK and partitions can be heartbreakingly exciting, if you catch my drift.
More Partitions = Data Parachute?
Some users advocate using multiple partitions for safety reasons. Their opinion is that in the event of a hard disk crash, corruption to the boot sector or FAT (File Allocation Tables), only the primary partition will be lost, leaving precious data safe in the other partitions.
Unfortunately, from my experience involving hard disk crashes, every partition was inevitably wiped out. When a hard disk head crashes with a platter, I seriously doubt it would politely avoid scoring through the media that has been allocated to other partitions.
Russ Johnson, a Product Support Engineer from Symantec Corporation has this to say, "It's not a substitute for a good backup, but it may save you from having to restore all of your data from a backup. However, if your first partition is taken out, more than likely the whole drive will be lost. The first partition is also the location of the Master Boot Record and the partition table."
Now, I agree that storing your data on a different partition is actually a good practice. It can save your data if the first partition gets corrupted due to a soft error. For example, even if the FAT of one of the partitions gets corrupted, data on the other partitions will still be safe.
So, if data integrity (as well as disk management) is important to you, you should consider using multiple partitions. However, this does not mean you should move the paging file to a different partition... oh no...
When the paging file is permanent, tweakers who advocate moving paging files around will tell you to move your partition to a second hard disk. Why?
As the theory goes, this allows your system to access both the paging file on the second hard disk and data on the first hard disk concurrently. This theoretically improves performance a lot! But does it really work?
Well, it depends.
Hard Disk, NOT Partition!
Many people get confused by drive letters. They assume that moving the paging file from drive C: to drive D: is the same as moving it to another hard disk. However, this is not true.
The operating system does not bother with physical drives. It is only interested in logical drives. By this, we mean properly-formatted partitions that can be accessed by the operating system.
To the operating system, partitions appear as physically-separate hard disks although they may reside on the same hard disk. If you partition your hard disk into three different partitions, your operating system will identify them as three logical drives (Drive C:, Drive D: and Drive E:). But they are still physically on the same hard disk!
Therefore, if you merely move the paging file to a different logical drive, you could be doing nothing more moving it to a different partition. So, please check and make sure you are moving it to a physically-separate hard disk. Preferably, it should be the first partition in that hard disk.
Parallel-ATA
Many tweakers forget one thing when they move their paging files to the second hard disk - only one PATA (Parallel-ATA) device can be active at any one time on the same IDE channel.
Most users slave the second hard disk to the first hard disk on the primary IDE channel and put the removable media drives (CD writers, DVD-ROM, etc.) on the secondary IDE channel. That is theoretically sound practice but it actually negates the purpose of moving the paging file off the primary hard disk!
Because both hard disks are on the same IDE channel, they can't be active at the same time. So, there is no way data can be read from both hard disks at the same time. In fact, because the secondary hard disk is often slower and smaller than the primary hard disk, the performance of the paging file on the second hard disk will actually be worse off.
So How Do We Make It Work?
The only way for this method to work is to put the first and second hard disks on separate IDE channels. That means the first hard disk gets hooked up to the primary IDE channel and second hard disk gets the secondary IDE channel. This allows both IDE channels can be active at the same time, delivering data from both hard disks concurrently.
In addition, the second hard disk needs to be at least half as fast as the primary hard disk. This allows the paging file on the second hard disk to be at least as fast as a paging file on the first hard disk. Otherwise, the performance advantage accessing the paging file concurrently on a second hard disk will be negated by the slower performance of the second hard disk.
Remember, if the first hard disk can serve data to and from both the application in use and the paging file faster than the second hard disk can access the paging file alone, then it is pointless to maintain a paging file on the second hard disk.
But if the second hard disk is more than half as fast as the first hard disk, then it would be advantageous to move the paging file there because the paging file can then be accessed concurrently with data on the first hard disk. In addition, the valuable outer tracks on the first hard disk will be freed up for use by the operating system.
Other Considerations
The trouble with such a setup is that most motherboards usually with only two IDE channels.
If you slave your DVD writer to the first hard disk (on the primary IDE channel), then you may have trouble writing data from the first hard disk to a DVD. This is because the IDE channel has to interleave its operations between the first hard disk and the DVD writer.
You won't have any trouble writing data from devices on the second IDE channel to the DVD writer though. This is because the DVD writer is on the first IDE channel and can thus be accessed concurrently with the devices on the second IDE channel.
However, if you slave your DVD writer to the second hard disk (on the secondary IDE channel), then you may have problems with games running off CDs or DVDs in that drive. Of course, this time you won't have any trouble writing data from devices on the first IDE channel to the DVD writer!
Either way, you will face performance compromises. It is a great idea but implementation is not quite as simple as you might think. The key to making this work is to be aware of such considerations and plan your setup accordingly.
But if your motherboard comes with enough IDE channels to give each device its own channel, then the way is clear - hook the second hard disk to a separa
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -