PC Hardware

Configuring Virtual Memory

As mentioned earlier in this tutorial, virtual memory allows the processor to use the hard drive to simulate RAM. Applications can access this simulated memory through virtual addresses mapped onto physical addresses, which can be either in RAM or on the hard disk.

Virtual Memory Manager

All virtual memory is controlled by the Virtual Memory Manager (VMM). The VMM divides memory into 4-KB pages and then maintains a page table to keep track of where everything goes (in RAM or on the hard drive). When the amount of free RAM reaches a critical level, a portion of RAM is set aside for page swapping. Windows uses a temporary or permanent swap file on the disk for writing the least recently used page frames of physical RAM.

Temporary Swap File

A temporary swap file is recommended when a computer is low on disk space because the file can increase or decrease in size as necessary. The temporary file is called \Windows\Win386.swp, and it's deleted when you exit Windows.

Permanent Swap File

When disk space is not a problem, a permanent swap file is recommended. Permanent swap files are faster to access than temporary swap files because they use contiguous blocks (clusters) of the hard disk drive to store data.

Sizing Virtual Memory

The required size of virtual memory varies with every machine and depends upon the memory requirements of the applications that will be run at the same time. When setting up virtual memory, consider the following:

  • Total memory requirements of the computer should equal RAM plus the size of the swap file.

  • The maximum swap file should not be larger than three times the size of RAM memory.

  • Maximum total virtual memory should not be larger than four times the size of RAM.

To determine the actual memory requirements for a machine, add together all the memory requirements for each application to be run concurrently and add an extra 1 MB each for MS-DOS and Windows.

Swap File Settings

Swap files are modified using the Control Panel's 386 Enhanced icon. Select the Virtual Memory button on the right side of the dialog box. The following settings are recommended:

  • Drive: Use the disk drive with the most available space. Do not select any removable drives such as floppy disk drives or Zip drives (they are too slow).

  • Type: For best performance, use a permanent swap file (be sure to defragment the drive first-this will provide a space for a contiguous file).

  • Space Available: Calculate the recommended size. Consult your application manuals to determine the amount of memory required to run each of them. Use a value large enough to support the workload on the computer, but do not exceed the recommended maximum size as suggested by Windows in the Virtual Memory dialog box.

  • 32-bit access: Use 32-bit access if available. It requires a Western Digital WD1003, or compatible, drive. Using 32-bit disk access allows Windows to talk directly to the hard drive, (thereby skipping the requirement to open an MS-DOS session), which then talks to the BIOS and then to the drive. 32-bit file access can be used with Windows 3.11 or Windows for Workgroups. It works the same as 32-bit disk access and can often speed up drive access. 32-bit file access is not hardware-sensitive and can often work when 32-bit disk access won't.

NOTE
If the drive controller is not compatible, this option will not be available.

Out of Memory

"Out of memory" messages from Windows usually means "out of conventional memory." However, it can also mean there is a shortage of virtual memory. Try closing files or increasing virtual memory as a temporary fix. If the message continues to appear, even after a reboot, the memory usage of the system should be evaluated and modified if needed.