Paging File


As you may already be knowing that your computer needs Random Access Memory (RAM) for carrying out the various tasks you assign to it. When you are using a program, like a web browser, a copy of this program is saved to the computer RAM and you are using the program from there. So if you are using multiple programs simultaneously, you will need a lot of RAM space. When this extra space required, is not available in RAM, the CPU utilizes the space available in the hard drive as RAM. You might think 'that's great! So I don't need a lot of RAM, I'll just buy a huge hard disk' but you will be disappointed to know that it doesn't work that way. The data reading and writing speed of the hard drive is slower than the RAM. Also, if the processor has to switch between the RAM and the hard drive for temporary storage of programs being used, your computer will slow down. This is known as thrashing. In the rest of the article I will introduce you to the concept of paging file, its function and correct usage.

Paging File Explained

As I have said in the introduction above, if sufficient RAM is not available, the processor will use the space on your hard drive. And the space on the hard disk that stores the RAM image is called a page file. It holds pages (blocks of data) of RAM on the hard disk, and the operating system moves data back and forth between the page file on the hard disk and RAM. So the page file acts as extra RAM. Its function is to expand the amount of actual RAM and make it available to the CPU. All the services and installed applications can make use of this surplus RAM, even though it is different from the sticks that plug into the motherboard. This paging file is sometimes referred as virtual memory.

How to Locate

By locating, I mean placement of the paging file. By default, the paging file is placed into the hard drive partition that houses the operating system. When the CPU is using the page file it becomes slow because accessing the system files and the page file simultaneously is not possible so the computer becomes slow. Also, you cannot place the file on another partition is not possible. But if you have an extra hard drive, you place the file onto it and improve computer performance. If you have multiple hard drives, you can make small paging files on each of them. This will really boost the computer performance.

The Ideal Size

In most operating systems, the paging file size is automatically assigned by the system. In Windows XP, the size of a paging file is three times your physical RAM. But if you have large games and software installed, which you use often, the system will require more RAM. This extra need will be fulfilled by the usage of the same. The size of the page file dynamically changes as and when required. But that slows things down. So one trick to avoid that is make the minimum and maximum size of the paging file same. Although nowadays, all the advanced operating systems support a lot of RAM and people use around 2 or 3GB of RAM normally. But still you cannot just eliminate the paging file. Also, you cannot keep it too small as some programs still require some amount of virtual memory to function.

I hope you have got all the basics of virtual memory paging file cleared down to the core.

Blog Archive