There are a lot of tips on virtual memory optimization floating around the web, but many of them don't hold up to scrutiny. Let's take a look.
Opinion 1: For users with large amounts of physical memory, virtual memory can be disabled altogether. To understand this thoroughly, you first have to understand what virtual memory is and what it does. In the early days, because the price of memory is very expensive, so the general computer will not be configured too much, then sometimes if the operating system and applications require more memory than the amount of physical memory installed in the computer, the operating system will temporarily write the data that do not need to be accessed by a kind of operation called "paging" to the hard disk, a special file, thus giving the user the opportunity to access the data. The operating system temporarily writes unneeded data to a special file on the hard disk through an operation called "paging" to free up memory for programs and data that need it immediately. This special file on the hard disk is a paging file (also known as a virtual memory file or swap file). For Windows 2000/XP/2003, the pagefile is called pagefile.sys and is located by default in the root directory of the operating system partition.
Now that we know where virtual memory comes from and what it does, those who hold this theory believe that there is a world of difference between the speed of a hard disk and that of memory, and that if virtual memory is disabled, the system won't need to take the time to page data from memory to the hard disk, thus making it more efficient to run the system. However, by design, many of the core functions of Windows require the use of paging files, and some third-party applications may encounter out-of-memory errors if you disable all paging files. Windows doesn't use paging when it doesn't need to, so you won't get any performance gains from tweaking your system this way.
Opinion 2: For virtual memory, the recommended setting is 1.5-2 times the amount of physical memory (the minimum and maximum values for virtual memory, respectively). Before discussing this first look at two scenarios: there are two computers with all the same configuration except for RAM. Computer A has 128MB of RAM and Computer B has 1GB of RAM, and both computers run the Windows XP operating system. According to the method of setting this point of view, the virtual memory of computer A will be set to 192MB-256MB, and the virtual memory of computer B will be set to 1.5GB-2GB. Then in actual use, computer A is likely to run large-scale software or games when the virtual memory is insufficient to produce the problem, and computer B will be set up because of such a large paging file and lead to hard disk space Waste. How to set the virtual memory according to the actual situation, this we will introduce in the following.
Viewpoint 3: We can use memory release software to free up the memory occupied by running programs to improve system efficiency. Before rejecting this idea, we must first understand one thing, any program, as long as it is executed, will occupy a certain amount of memory space (the exact amount of memory occupied depends on the size of the program itself and the size of the data file loaded), so this so-called memory release software is how to take effect? The software does not exit, from where to release the memory? This is the first time I've ever seen a PC with a USB 2.0 controller, and I've never seen one before.
For those of you who have this type of software installed, try opening Windows Task Manager, opening the Processes tab, and then selecting the Select Columns command under the View menu, and then selecting the Select Columns dialog box that appears. Select the option "Virtual Memory Size" in the Select Columns dialog box that appears. Your Task Manager will then look something like Figure 1.
Memorize the amount of memory and virtual memory used by each of the processes that are taking up a lot of memory, and then free it up with memory freeing software. In this article, we will use Microsoft's Windows Server 2003 Resource Kit tool empty.exe, the tool has been very popular on the Internet for some time, many people claim to have the role of free memory release (although there are other tools to release memory, but the principle is the same). Run "empty *. *", you can see that, for a short time, the processes that previously occupied a lot of physical memory have become very small in terms of physical memory, while the amount of virtual memory has increased (Figure 2), but this phenomenon only lasts for a short time. Immediately, the amount of physical memory used by these processes started to go back up again.
So it's safe to say that this type of memory-freedom software doesn't do much at all. Instead, some software can automatically free up memory after a certain number of programs have reached a certain point, which can add insult to injury on an already busy computer. Imagine this situation, when you do not have much memory, and run a relatively large program, will inevitably lead to a sharp decrease in the number of physical memory, and in this case the so-called "optimization software" began to smart, the memory occupied data to the hard disk paging, and the operation of the program needs these data, which may lead to a This can lead to a situation where the optimizer tries to page the data to the hard drive, while the operating system tries to read the data from the hard drive to the memory, greatly increasing the read/write time on the hard drive.
In fact, in the early days, these programs were useful because the mainstream Windows 9x operating system itself had problems with memory management, and some poorly designed programs could have memory leakage bugs, so this type of software was created. But now the NT-based Windows operating system has greatly improved memory management, and the design of most software has become more and more reasonable, so we can say goodbye to this kind of software. With all the misconceptions circulating on the Internet, how do we set it up to achieve the best performance? First of all, let's look at how to determine the size of the virtual memory. As we have already said, strictly according to the 1.5-2 times the multiplier relationship to set up is not scientific, so we can set up according to the actual application of the system. In this process, you need to use the performance monitor that comes with Windows 2000/XP Pro/2003. Run "perfmon.msc" to open the performance monitor, expand the left side of the performance logs and alerts, and click to select the counter log, in the right panel of the blank right mouse button, select the New Log Settings, and named Pagefile, and then enter to confirm, and then there will be a window as shown in Figure 3.
Under the General tab, click the Add Logger button, select Paging File from the Performance Objects drop-down menu in the new pop-up window, and select "Select Logger from List", then click % Usage Peak, select "_" in the example, and then select "Total". Total" in the example, and then click the "Add" button, and the finished setup should look like Figure 4.
Under the General tab, click on the Add Tally button, select Paging File from the Performance Objects drop-down menu in the new pop-up window, select "Select Tally from List", click on % Usage Peak, select "_ Total" in the example, and then click on the Add button. Total" in the example, and then click the "Add" button, the finished setup should be the same as Figure 4.
Then close this window and click the "OK" button in Figure III. Click "Yes" to create the log file. Next, open the Log Files tab, select Text File (comma delimited) in the Log File Type drop-down menu, and then remember the path to the log file shown in the For example box. and then remember the path to the log file shown in the "For example" box.
This way, after clicking OK, you're up and running, and you can go about your day-to-day business on your computer, opening and closing as many of your favorite apps and games as you like. After a few hours of use, you'll basically have a complete evaluation of your usage.
At this point, you need to stop the logger from running. Again, in the Logger Log window, select the new Page File logger we created, right-click on it, and select Stop. Open the log file in Notepad, and you should see results similar to Figure Six. Let's analyze the use of page files based on this image together.
It's important to note that the values in the log are not paging file usage, but rather utilization. That is to say, according to the log file shows that the system in general the paging file is only used about 25%, and the system is currently set up paging file enough 2GB, then in order to save hard disk space, it is perfectly possible to reduce the maximum value of the paging file to 512MB size. As for the minimum value, you can first find out the average occupancy rate based on the occupancy rate in the log, and then multiply it with the maximum value, you can get it. You also need to be careful when setting the virtual memory, if you have more than one hard disk, then it is better to set the paging file on the hard disk where no operating system or application is installed, or the fastest hard disk among all the hard disks. This way, when the system is busy, the same hard disk will not be busy reading data from applications and paging at the same time. On the contrary, if the application and the paging file are on different hard disks, this will minimize hard disk utilization and increase efficiency. Of course, if you only have one hard drive, there is absolutely no need to have the paging file on any other partition, and it doesn't matter which partition on the same hard drive it is on, it doesn't have a huge impact on performance.