Windows system virtual Memory Set the ultimate introduction _ Hardware Maintenance

Source: Internet
Author: User
Tags delete key temporary file storage disk defragmenter
Memory is very important in the computer, all the programs running in the computer need to go through the memory to execute, if the execution of the program is very large or many, will lead to memory consumption exhausted. To solve this problem, Windows uses virtual memory technology, that is, to take out a part of the hard disk space to act as memory, when the memory is exhausted, the computer will automatically call the hard disk to act as memory, to ease the memory tension. For example, if the computer has only 128MB of physical memory, when reading a file with a capacity of 200MB, you must use a larger virtual memory, the file will be read after the memory is stored in virtual memory, waiting for memory to store all the files to virtual memory, Then you will release the virtual storage files into the original installation directory.
When the system is running, the required instructions and data must be taken from external storage (such as hard disk, floppy disk, CD-ROM, etc.) into the memory, the CPU from the memory to read instructions or data for operation, and the results of the operation into memory, the role of memory as a "setter" role. When you run a program that requires a lot of data and consumes a lot of memory, memory this warehouse will be "stuffed", and in this "warehouse" there is always a part of the temporary use of data occupy a limited space, so this part of the "lazy" data "please" out to make room for "active" data use. Then you need to create another fallback "warehouse" to store "lazy" data. Because of the large amount of space on the hard disk, Microsoft Windows operating system will be the backup "warehouse" address selected on the hard disk, the backup "warehouse" is virtual memory. By default, virtual memory is saved in the system partition of the hard disk with a swap file named Pagefile.sys.
Set Virtual memory manually
The default state is to let the system manage virtual memory, however, the system default settings are usually more conservative management, in the automatic adjustment will cause the paging file is not continuous, and reduce the efficiency of reading and writing, the efficiency is not high, so often appear "insufficient memory" such a hint, let us start to set it.
① the "My Computer" icon on the desktop by right-clicking the "Properties" option in the right click menu to open the System Properties window. Click the "Advanced" tab in the window and the dialog box for advanced settings appears.
② Click the Settings button in the performance area to open its dialog box by selecting the Advanced tab in the Performance Options window that appears.
③ the dialog box to see the area of virtual memory, click the "Change" button to enter the "Virtual Memory" settings window. Select a partition with larger free capacity, check the box before custom size, fill in the initial size, maximum column, then click the "set → ok" button, and then restart the computer to take effect on the virtual memory settings.
Recommendation: A small partition can be divided into a dedicated to virtual memory, ie temporary file storage and other uses, the partition can be regularly disk collation, so as to better improve the efficiency of the computer.
One, tailored virtual memory
1. General Setting method
According to the general setting method, the virtual memory swap file minimum and maximum can be set to 1.5 times times the memory capacity, but if the memory itself is large, such as memory is 512MB, then it occupies a considerable amount of space. So we can set the basic value of virtual memory: the memory capacity below 256MB, set to 1.5 times times; over 512MB, set to half the memory capacity, between 256MB and 512MB set to the same value as the memory capacity.
2. Precise setting method
Because everyone actually operation of the application is not the same, such as some people want to run 3DMAX, Photoshop, such as large programs, and some people may just typing, playing games, so the requirements of virtual memory is not the same, so we have to adapt to local conditions to accurately set the value of virtual memory space.
① first the virtual memory custom "Initial size", "maximum" set to two identical numeric values, such as 500MB;
② then opens "Control Panel → admin tools → performance" in turn, in the Performance dialog box that appears, expand Performance Logs and Alerts in the left column, select the counter log below, right-click in the blank in the right-hand column, and select the "New Log Settings" option in the right menu.
③ in the pop-up dialog box "name" column to fill in any name, such as "virtual memory test." Click the "Add Counter" button in the window to enter the next window;
④ opens the Drop-down list of performance objects in this window. Select "Paging File", tick "Select counter from List", and select "%usage Peak" in the column below, check "Select sample from List", select "_total" in the column below, Click "Add → close" again to end
⑤ in the right-hand column can find a more "virtual Memory Test" project, if the project is red is not started, click on the item, select the right menu in the "Start" option can
Then run some of your favorite apps, run for a while, go to the default directory "PerfLogs" under the system partition where the log files are located, locate the "virtual memory Test _000001.csv" and open it with a Notepad program, where we look at the penultimate number in each column, This value is the usage ratio of virtual memory, find the maximum value of this number, such as "46" in the figure, with 46% times 500MB (the virtual memory value set above), the value is 230MB.
The initial size can be set to 230MB, and the maximum value can be set freely according to disk space size, which is generally recommended to be set to 2 to 3 times times the minimum value. So we can make virtual memory more accurate, so that their love machine run more smoothly, more efficient.
Second, Windows virtual memory acceleration secret
Virtual memory is important for any version of Windows. If set properly, it will greatly improve the performance and speed of the computer. However, in the default state, Windows always sets virtual memory to 1.5 times times the physical memory. In this way, if the user installs 2GB of memory, the system will free up up to 3GB of hard disk space as virtual memory. But with the current mainstream application software and games for memory needs, there is no need to use so much virtual memory. So, are there any tricks or tricks to make virtual memory more efficient or performance-conscious?
1. Split in multiple hard drives
Setting virtual memory on a faster hard drive does make virtual memory more efficient to operate. However, if your computer has two hard drives as fast, you should distribute virtual memory evenly on two different hard disks (not different partitions on the same hard drive). Because the synchronous read and write operation will more effectively improve the system overall virtual memory performance.
For example, if you originally set 700MB virtual memory on hard drive C, you can now try to reassign it by changing the hard drive C to 350MB and the hard drive D to add 350MB of virtual memory. In theory, this will speed up the overall reading and writing of virtual memory.
2, the hard disk must have enough space
If you are not a very experienced computer user, or have no special use requirements, in Windows XP to choose the "System Management Size" method to automatically process virtual memory, should generally be more than the choice of "custom size" approach to security and stability. However, it is important to note that since the "paging file" (Pagefile.sys) of virtual memory shrinks and expands as the computer is used, we must ensure that the hard disk on which the paging file resides has sufficient free space for the system to manage virtual memory smoothly and more flexibly.
3, the minimum value is equal to the maximum value
Select the custom size method to process virtual memory and set both the maximum and minimum values to the same value. There are many people who believe that using this method to process virtual memory can improve the performance of the system. The reason they hold is that when both the maximum and the minimum are equal, the system does not have to shrink and extend the paging file at all times. By eliminating these tasks, it is necessary to improve the efficiency of the system.
Many people believe that this approach is effective, but it is also pointed out that there is no effect. But anyway, if you want to set the maximum and the minimum to equal, we must stick to the principle that the virtual memory must be large enough, otherwise the system will be less efficient (more replication to make space), serious more will cause system instability.
4, finishing the page file
File data is stored on the hard disk for a long time, and file fragments (fragment) will naturally occur. To maintain or improve the working efficiency of the hard drive, we should defragment the hard disk from time to time. The so-called virtual memory, in fact, is also the data file on the hard disk, then the virtual memory should also be like a common document needs to be sorted out?
The way the Windows system handles paging files (that is, virtual memory) differs from the general file. In contrast, paging files are less fragmented than regular files, and it is often not necessary to defragment the paging file. In fact, the paging file is not involved when Windows XP is defragmenting the disk.
Although Windows does not defragment the paging file, the fact is that the paging file is fragmented. The pursuit of "perfect" friends may still want to defragment the paging file. You may wish to try the following methods:
Right-click the "My Computer" icon on your desktop and select "Properties" in the menu of features that appear later. Enter the settings window for the System properties, select "Advanced"--> "Performance"--> "Settings"--> "Advanced"--> "change" with the mouse, and select "No paging File" in the "Virtual Memory" settings window that appears later. Finally click the "Settings" button to exit and restart the computer.
After restarting, check to see if there are any Pagefile.sys paging files in the root directory of the disk, and delete them if they are available. Once you have cleared the paging file for virtual memory, we will now defragment the disk. When you are done, reset a certain amount of virtual memory by following the previous steps and start the computer to take effect. After the above method is processed, the newly-arrived paging file will be free of fragments.
Also, what if you want to see the details of the page file fragment? Start the Disk Defragmenter, "Analyze" the hard disk that has the paging file, and then click "View Report" to see the "Page File Fragmentation" column.
5, the ideal size of virtual memory
How much virtual memory should be set up to handle virtual memory in a "Custom size" way? In Windows XP, if virtual memory is defined by the operating system itself, the system usually sets the minimum to 1.5 times times the physical memory. When extended, the maximum value is between 2.5 and 3 times times the physical memory. In general, users want to customize the size of virtual memory, you can refer to this scale setting.
Do you really have to refer to this ratio? If my computer has 1GB of memory, the minimum value is set to 1.5GB, the maximum value is 2.5 to 3GB. So. Pagefile.sys page file is at least 1.5GB, too unrealistic!
In fact, the system of large memory compared with small memory system, when setting virtual memory, the standard is somewhat different.
If you have more than 512MB or even 1GB of memory, now that the physical memory is quite sufficient, the required virtual memory should instead be reduced. Therefore, in a large memory system, the minimum value of virtual memory can be set to half of the physical memory. For example, 1GB of memory, the minimum value of virtual memory set to 512MB, the maximum value is maintained 3GB for a rainy. Note: Although the maximum is set to 3GB, the system will not immediately appear 3GB size of the Pagefile.sys file, in fact, it will first appear as a minimum value, the extension will be required to increase.
In addition, some friends with large memory may simply not set virtual memory to force the system to use faster memory. In fact, this is not very sensible approach. It is the so-called do not do everything too absolutely, no virtual memory at all. The reason is that many applications in the design of the need to use virtual memory, without it will cause system instability or panic.
As for small memory systems, such as 256MB, reference 1.5 times times and 3 times times the setting ratio is the most stable. That is, the virtual memory minimum is set to 384MB and the maximum value is 768MB.
6, manually customized the most accurate virtual memory
0.5 times times, 1.5 times times, 3 times times, wow! It seems that buying clothes is big, medium and small, and has no personality at all. Is there a more "trim" approach to setting up virtual memory?
Enter Perfmon.msc in the start → run of the Windows XP desktop, and a monitor that is related to system performance appears. Look at the bottom of the display with three counters (pages/sec, Avg.Disk Queue length, and rocessor time). To make it easier for us to monitor the page files of virtual memory next, please select each of these three counters one at a time and press the DELETE key on the keyboard to delete them. Please rest assured that after the deletion, the next time you start System Performance Monitor, these three items will appear again.
Once removed, click the right mouse button in the center of the chart, select Add Counters in the menu that appears, and then select Process in the Performance object column of the pop-up window. Then select "Page File Bytes" in the "From List Selection" column. It's not clear what the "Page File Bytes" means, as long as you click the "description" button and the narration text appears under the dialog box.
After you select Page file Bytes, select the total item in the "Select Sample from List" column to the right, and then click the Add and Close buttons, and a counter named "Page File Bytes" appears below the Performance Monitor.
Repeat the above action and add a counter named "page File Bytes Peak" (that is, the page file Bytes Peak below the process).
Now, looking back at the monitor, the chart should be showing and measuring the two new counters that have just been added. In the event of no accident, the two counters are not displayed correctly on the chart, that is, the value is near the highest proportional line and there is no dynamic change. Don't be afraid, it doesn't mean that your computer is out of the question, but the chart is not properly set. Right-click the page fele Bytes and page File by8tes Peak counters at the bottom of the monitor and select Properties. In the scale column of the data page, change to 0.0000001 so that the chart in the monitor is no longer static.
If you have read the instructions provided by the system, you should be aware that the page file Bytes and page file Bytes Peak represent the amount of virtual memory used during system monitoring and how big its spikes are. Therefore, you need to manually set virtual memory, you can refer to the number shown below the chart, the unit is bytes
Want to know how much virtual memory your system will consume under normal circumstances? Please start the daily application software at the same time and let them start to work, then look at the performance Monitor displayed on the value of the right.
People always have a crazy time, want to know how crazy you use the computer when the system needs the amount of virtual memory, now enjoy the computer on the program to start and run (for example, open more than 10 IE browser window to the Internet, play MP3 and DVD movies, and then disc burning or DV video compression code), See how much the monitor's percentage will rise.
Right-click on the chart, click Properties, and go to the chart page to check the horizontal grid. So there will be a line of horizontal dividing lines in the chart, is it good to distinguish?
The red vertical line in the chart runs too fast to open the computer program for testing?
Also, click the right mouse button on the chart and select Properties to change 1 seconds to 5 seconds in the automatic sampling interval of the regular page. At this point, the graph time value in the chart changes from 1 minutes to 40 seconds to 8 minutes and 20 seconds. In other words, it takes 8 minutes and 20 seconds to walk a red straight line, which should be enough for everyone to open and run many applications, and then slowly look at the results in the chart.
Finally, through the monitor chart, I believe you can roughly estimate how much virtual memory your computer system should set up.
Third, the emergence of "virtual memory is not enough" several possible
1, infection virus
Some viruses take up a lot of memory space when they occur, causing the system to have a memory problem. Quickly to antivirus, upgrade the virus library, and then the anti-virus measures to do a good job!
2. Improper setting of virtual memory
Improper virtual memory settings may also lead to out-of-memory problems, under normal circumstances, virtual memory size of twice times the size of physical memory, if set too small, it will affect the normal operation of the system program. Resize virtual memory to WinXP for example, right click on "My Computer", select Properties, then on the Advanced tab, click the Settings button in the performance box, switch to the Advanced tab, and then click the Change button in the Virtual memory box, and then reset the virtual memory size. It's good to reboot the system when it's done.
3. Insufficient system space
Virtual memory files are in the system disk by default, such as WinXP virtual memory file named "Pagefile.sys", if the system disk space is too small, resulting in insufficient virtual memory, there will be insufficient memory problems. The system disk must retain at least 300MB of space, of course, this value depends on the user's actual needs. Users try not to install a variety of applications in the system disk, to ensure that there is enough space for the use of virtual memory files, and it is best to put the virtual memory files on the system disk.
4, because the system user rights are not set properly
When Windows system starts on the NT kernel, the system user creates the virtual memory files for the systems. Some users use the NTFS file system for system security, but cancel the system user's "write" and "modify" permissions on the systems disk, which makes it impossible to create a virtual memory file for the system, and an out-of-memory problem occurs when running a large program. The problem is solved by simply giving the system user write and modify permissions, but this is limited to users who use the NTFS file system.
Four, the virtual memory optimization
1. Enable disk write caching
Right-click on My Computer to select Properties-> hardware, open Device Manager to locate the hard drive you are currently using, and right-click to select Properties. On the policy page of the hard disk properties, turn on enable write caching on disk.
This option will activate the hard drive's write cache to increase the drive's read and write speed. Note, however, that when this feature is turned on, a sudden power outage on the computer can result in irreparable data loss. Therefore, it is best to turn this feature on with UPS. Of course, if you usually use the computer do not do any important data processing work, no UPS does not matter, this function will not cause too much damage to the system.
2. Open Ultra MDA
In Device Management Select the basic/Secondary IDE controller in the IDE ATA/ATAPI controller, right-click Select Properties, and open the Advanced Settings page. The most important setup item here is "transfer Mode", which should generally be selected as "DMA (if available)".
3. Configure Recovery options
When a fatal error is encountered during Windows XP run, a snapshot of memory is saved as a file for system debugging purposes, and this file is useless for most ordinary users, but it can affect the performance of virtual memory. So it should be closed.
Right-click on My Computer, select Properties-> Advanced, click the Settings button under Performance, and select the Advanced page in Performance options. There is a "memory usage" option that, if set to system cache, Windows XP uses about 4MB of physical memory as a cache for read and write hard disks, which can greatly increase the speed of data exchange between physical and virtual memory. By default, this option is turned off, and if your computer has more physical memory, such as 256M or more, you might want to turn this option on. However, if physical memory is more stressful, the default option should be retained.
Settings for the paging file
Size Calculation of paging file
Paging files vary in size for different computers. About the paging file size setting, there are two widely circulated "formulas", "Physical memory X2.5" or "Physical memory X1.5". These two methods of calculation are simple, but they are not applicable to all computers. The most accurate way to set the paging file size is to look at the size of the paging file that the computer actually uses in the normal run.
The log feature with Windows XP allows you to monitor the size of the paging file that your computer normally uses, and to make the most accurate settings, as shown in the following steps.
Right-click on My Computer, select Properties-> Advanced, click the Settings button under Performance, and then select the Advanced page, and click the Change button under virtual memory. "" Select Custom size and set the start size and maximum values to 300M, which is only a temporary setting. Restart the computer when Setup is complete to make the settings take effect.
Second, enter the control Panel-> performance and maintenance-> management tools, open performance, expand Performance Logs and warnings, and select counter logs. Right-click the right mouse button to select new log settings
Third, casually set up a log name, such as "Monitoring virtual memory size."
On the General page, click the Add Counters button.
In performance object, select Paging File, select%usage Peak under Select registers from list, and select _total from the Select an example from list on the right. Finally, click the Add and Close buttons.
Don't forget to remember the log file location and file name in the log file page, and we need to check this log to determine how much virtual memory Windows XP normally uses, in this case, the log files are stored in the D:\Perflog directory.
Also set the "log file type" to "text file" to make it easier to read.
Now you can see that the icon in front of the newly created log entry turns green, which indicates that the log system is already monitoring virtual memory. If the icon is still red, you should click the right mouse button to select "Start" to start the log.
After a while to open the CVS file, we can see the following items.
This log file records the use of the paging file for this period of time, noting that the unit here is%, not MB. With a simple calculation, we can get the minimum size of the paging file, which is "page file size x percent". For example, the maximum usage rate for virtual memory is 31%,300MBX31%=93MB, which is the minimum value of virtual memory (note that 300MB is the temporary value of the previous setting).
If the physical memory is large, consider setting the paging file start size and maximum to equal, equal to the size calculated in the previous step. This will not cause disk fragmentation due to the expansion of the paging file in the hard drive, and its side effect is that the "maximum" is set to a lesser size, in case of accidental virtual memory overruns, which can cause the system to crash.
Setting the paging file
Now go back to the Virtual Memory Settings dialog box to select a custom size and set the initial size and maximum values according to the results of the above calculations. Here we set the "Initial size" to 91M, and the "Max" set to 200M, so it's safer
Defragment a paging file
Windows XP runs with a large amount of access to the paging file, and if the paging file is fragmented, the system performance will be severely affected and the hard disk life will be shortened. So it is necessary for us to defragment the paging file regularly.
But don't forget, the paging file is a system-critical file that Windows XP cannot access while it is running. So it's not easy to defragment it. We have two options, one is to install the Windows dual system, and then start another windows to defragment the partition where Windows XP resides. The second is to use specialized tool software, such as System File Defragmenter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.