sharethis:
The Microsoft Windows paging file, also known as the swap file and virtual memory, is very important to the operation of the operating system. Providing a critical memory feature by allowing the operating system to use more random access memory (RAM) than the computer actually has allows users to use more robust programs without having to upgrade their memory.The paging file can be thought of as a large file on the hard disk that is a collection of system memory used by open applications and operating system components. As more and more applications are started, the amount of free space in the system memory, the RAM, decreases and can eventually be completely used up.When a user starts a program and the RAM used is full, the operating system still loads an application into memory. Before it can do that, it must first make room, and so it pushes a page of low-priority memory out of the RAM and into the paging file.The exact method that the system uses to decide what programs will stay in the physical RAM and what programs will go is unknown. However, there are several paging file hacks that will help you optimize your computer’s use of the paging file.With the help of hacks to the System Registry, you can prevent certain files from being pushed into the paging as well as completely disabling the paging file.
Disabling the paging file
Users of computers with a large amount of RAM have the ability to stop the operating system from pushing any data out into the paging file. This will allow for the faster memory management and memory access that is physically possible for your RAM. Reading and writing directly to the RAM is always significantly faster than having to use the page file. Reading and writing to the paging file requires multiple steps and that takes time. Moreover, reading from the hard drive is nowhere as fast as reading from the RAM.If your system has a large amount of RAM, over 1 gigabytes, then you can consider disabling the paging file. If you have less than 1 gigabyte of RAM, do not even consider disabling the paging file or else you will be running into problems.What can happen if you disable your paging file? If you have enough RAM, then nothing.But if you do not have enough RAM, then if you run a large program such as Photoshop and are working on a large image, you will run into “out of memory” errors and the application will crash, causing you to lose all of your work. This is a pretty extreme example, but it can happen.Basically, stick to the 1 gigabyte minimum and you will have no problems. But be aware that if you ever choose to run some memory-intensive applications, such as rendering a two-hour 3D movie, you could run out of memory easily.So, now that I have warned you, are ready to follow these steps to disable the paging file:
1. Enter System Properties, either by right-clicking the My Computer icon on the desktop and selecting Properties or by doing the same to the My Computer icon in the StartMenu.
2. Once the System Properties window has loaded, click the Advanced tab and then click the Settings button under Performance.
3. Once you are in the performance options, click the Advanced tab again.
4. Click the Change button that is located under the Virtual Memory section.
5. This will load the Virtual Memory screen. Locate and select the No Paging File radiobutton, under the Paging File Size for Selected Drive section.
6. Click the Set button and then click OK three times and you are finished. After you reboot, your page file will be disabled.Feel free to delete the pagefile.sys file from your hard drive after you reboot to claim some extra few hundred megabytes of free space.If you do not have enough RAM to disable the paging file completely, follow the directions in the next section to adjust the size of the paging file for best performance.
Adjusting the size of the paging file
The size of the page file can automatically be set by the system or it can be set by the user. In some situations, having the page file managed by the system is a good idea, but in others, it is better to manage the paging file yourself.The biggest argument for setting the paging file size and limit manually is to eliminate the growing on the page file when it is set by the system.When the system is managing the size of the paging file, it will monitor the size of the file and will then automatically make it larger when it is needed. This causes two problems. First of all, it causes a noticeable delay for all applications running on your computer because the computer has to expand the paging file and this is a hard disk–intensive operation. Secondly, allowing the system to grow and shrink the paging file causes fragmentation errors.For the sake of having enough speed, your page file should not have any file fragments. In the next section on defragmenting, you will learn exactly how to do this. But before the defragmentation can be successful, the page file needs to have a constant size. If the page file will be growing frequently, and because the defrag utility has no clue by how much, it cannot put the file in a place on the hard disk so that it will never get fragmented, as is the case when you set the page file manually to Constant Size.Setting the paging file to a constant size does have some disadvantages. For example, the lost disk space taken up by the paging file can be as high as 1 gigabyte. Additionally, when you set the maximum paging file size manually, you are setting a limit that your computer can never go above. Should you run some extremely memory-intensive application and your limit is too low,your paging file will fill up and you will be out of luck.Why setting the correct paging file size is so important. A real easy way to calculate the maximum size of your page file will be to take the recommended size of the page file from the Virtual Memory Settings window, and multiply it by 2.5. If you are having problems finding where your computer states the recommended size,perform the following steps for changing the paging file to a constant size, because this value is on the same screen as that on which you will be working.Now that you are ready to optimize the paging file to a constant size, follow these steps:
1. Get inside the System Properties again. Do so by right-clicking one of the MyComputer icons that is either in the Start Menu or the desktop and selecting Properties.
2. Next, click the Advanced tab and click the Settings button under the Performance section.
3. On the Performance Options window, click the Advanced tab and then click the Change button under the Virtual Memory section.
4. This will bring up all of the page file settings. Once this information is shown, you will want to modify the custom values so that the initial and maximum sizes are the same.Enter in the value that you calculated in these two boxes. If you have not yet calculated what your size should be, you will find the recommended size on the bottom of this window.
5. Click the Set button and then click OK three times to close all of the windows and save your settings.Once you restart, you will be using the new constant size paging file. You are now ready to run your defragmenter to defragment the paging file to ensure optimal performance.
Be aware: The method that I use to calculate the size of the constant paging file is a very conservative approach. I figure it would be better to be safe than sorry. The method of calculating the size is an effective one. However, if you feel the need for more free disk space, feel free to play around with the calculation, such as only multiplying the recommended amount by 2 ormaybe even 1.5. Although if you do that, keep in mind that you will be increasing your chances of maxing out your paging file.
Defragmenting the Windows paging file
The Windows paging file can be quite large, as you know from the previous sections. Once you have created a constant size paging file, or if you just want to defragment the paging file, you can defragment the file during the next system boot.Windows will not allow any program to move the paging file around on the hard drive when the operating system is in use. The main reason why Windows does not allow this is because other programs are running in the background as well as operating system services that will depend on the paging file. This is why the defragmentation can only be done during the boot, because very few files are in use then.The built-in Windows XP defragmenter does not defragment the paging file during a normal defrag. Microsoft has a workaround for this limitation. It tells users to do a normal defrag first,then after the free space is consolidated, to delete the paging file by disabling it and then recreating it right after a fresh defrag. Doing so will cause the operating system to create one big,continuous file on the hard drive.
If you want to clear the page file on each shutdown
1. Start up the Registry Editor by clicking the Start Menu and selecting Run. Then typeregedit in the box and click OK.
2. Once the Registry Editor has opened, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\ClearPageFileAtShutdown
3. Look for the ClearPageFileAtShutdown entry and right-click it and select Modify.
4. Enter 1 as the new value in the box and click OK.
5. Close the Registry Editor and restart your computer to see the new changes.
0 comments