Check out these hard drives! HollenderX2 / Getty ImagesVirtual memory is an essential feature found in most operating systems on desktop computers. Its widespread use is due to the substantial benefits it offers users at an extremely low cost.
In this article, you'll explore the concept of virtual memory, how your computer utilizes it, and how you can configure it on your device to maximize performance.
Modern computers typically come with around 32 or 64 megabytes of RAM for the CPU to utilize (see 'How RAM Works' for more details about RAM). However, this amount of memory is often insufficient to run all the applications that users expect to have open at once.
For instance, if you try to load the operating system, an e-mail program, a web browser, and a word processor into RAM all at the same time, 32 megabytes simply won't be enough. Without virtual memory, your computer would give an error saying, 'Sorry, you cannot load any more programs. Please close an existing program to open a new one.' Thanks to virtual memory, though, the system can check for areas of RAM that are not currently in use and transfer them to the hard drive. This creates space in RAM for loading the new application.
This copying process happens automatically in the background, so you don't even realize it. It allows your computer to act as if it has unlimited RAM, even though it only has 32 megabytes installed. Additionally, since hard drive space is much less expensive than RAM, it also offers an economical advantage.
However, the read/write speed of a hard drive is considerably slower than that of RAM, and hard drive technology is not optimized for quickly accessing small chunks of data. If your system relies too heavily on virtual memory, you will notice a substantial decrease in performance. The key is ensuring you have enough RAM to manage everything you typically work on simultaneously; when you do, you will only notice the minor delay of virtual memory during task switching. This is when virtual memory performs perfectly.
If there isn't enough RAM, the operating system will continually swap data between RAM and the hard drive. This process, known as 'thrashing,' can make your computer seem incredibly sluggish.
The section of the hard drive dedicated to storing the RAM image is called a page file. It temporarily holds pages of RAM, allowing the operating system to transfer data between the page file and RAM as necessary. On Windows systems, page files typically have a .SWP extension.
Now, let’s explore the process of configuring virtual memory on a computer.
Setting Up Virtual Memory

Windows 98 serves as a prime example of an operating system that utilizes virtual memory. It features a sophisticated virtual memory manager that applies default settings to help allocate hard drive space for virtual memory as required. For most users, these default settings are sufficient, but manual adjustments may be necessary, particularly if you have multiple physical hard drives or need to optimize for speed-sensitive applications.
To manually adjust virtual memory settings, first open the "Control Panel" and double-click the "System" icon. When the system dialog appears, select the "Performance" tab and then click on the "Virtual Memory" button.
Select the option that says, "Let me specify my own virtual memory settings." This will activate the settings below that statement. Next, choose the hard drive you wish to configure for virtual memory by clicking the drop-down menu next to "Hard disk:". As a general guideline, it's a good idea to split virtual memory evenly across the physical hard drives in your system.

In the "Minimum:" field, enter the smallest amount of space you want to allocate for virtual memory on the chosen hard disk. The values are in megabytes. For the "C:" drive, a minimum of 2 megabytes is recommended. The "Maximum:" value can be set to any figure you prefer, though a common upper limit is double the amount of physical RAM. The default in Windows is typically 12 megabytes more than the total physical RAM. After adjusting these settings, close the dialog and restart your computer to apply the changes.
The amount of hard drive space you assign for virtual memory is crucial. Assigning too little can lead to "Out of Memory" errors. If you find yourself continually increasing the virtual memory size, your system might be sluggish and frequently accessing the hard drive. In that case, it’s advisable to add more RAM, aiming for a 2:1 ratio of RAM to virtual memory. Some applications benefit from large virtual memory allocations but rarely use them, in which case large paging files work effectively.
One method to enhance the performance of virtual memory, particularly when dealing with large amounts of it, is to set the minimum and maximum sizes of the virtual memory file to be identical. This ensures that the entire paging file is allocated when the system starts, preventing it from growing during operation, which can improve overall performance. This technique is often recommended for video applications to avoid delays while transferring video data between the hard disk and tape.
The location of the pagefile also plays a role in virtual memory performance. If your system contains multiple physical hard drives (not just different drive letters, but actual physical drives), you can distribute the workload by creating smaller pagefiles on each drive. This simple adjustment can significantly improve the performance of systems that rely heavily on virtual memory.
This article is part of a series that covers various aspects of computer memory, including:
- How Computer Memory Functions
- How RAM Operates
- How ROM Works
- How Flash Memory Functions
- How Caching Works
- How BIOS Operates
