Optimizing the Swap File

Windows 95 uses a special file on your hard disk called a virtual-memory swap file (or paging file). With virtual memory under Windows 95, some of the program code and other information are kept in RAM while other information is swapped temporarily to virtual memory. When that information is required again, Windows 95 pulls it back into RAM and, if necessary, swaps other information to virtual memory. This activity is invisible, although you might notice that your hard disk is working. The resulting benefit is that you can run more programs at one time than the computer's RAM would usually allow.

On Windows 3.x, users could enhance performance by changing virtual memory settings. The Windows 95 swap file is dynamic, so it can shrink or grow based on the operations performed on the system and based on available disk space. A dynamic swap file is usually the most efficient use of resources. The swap file can also occupy a fragmented region of the hard disk with no substantial performance penalty.

Tip for Swap File Performance

The single best way you can ensure high swap file performance is to make sure that the disk containing the swap file has ample free space so that the swap file size can shrink and grow as needed.

The Windows 95 swap file (WIN386.SWP) is not a permanent file. However, Windows 95 can also use a permanent Windows 3.1 swap file. In this case, the file cannot shrink below the permanent size set for it in Windows 3.1, although the file can grow bigger if required.

Under Windows 95, the swap file can reside on a compressed drive if a protected-mode driver (that is, DRVSPACE.VXD) controls the compressed drive. DriveSpace marks the swap file as uncompressible and, to reduce the risk of fragmentation, places the swap file as the last file in the sector heap, which allows room for the swap file to grow.

For a computer that runs a shared version of Windows 95 from a server, the swap file is placed in the computer's machine directory. If the computer is started from a floppy disk or uses remote booting, the swap file is in the machine directory on the network. If the computer is started from the local hard disk, the swap file can be stored in the machine directory on the local computer.

Although the system defaults usually provide the best performance, you can adjust the parameters used to define the swap file. For example, to optimize swap file performance on a computer with multiple hard disk drives, you might want to override the default location of the Windows 95 swap file. The swap file should be placed on the drive with the fastest performance (unless that disk is overused). If a user usually loads all software from the same drive in a computer that has multiple drives, performance might be boosted by placing the swap file on one of the drives that is not as busy.

Caution Completely disabling virtual memory might cause the computer to stop operating properly. You might not be able to restart the computer, or system performance might be degraded. Do not disable virtual memory unless instructed to do so by a technical support representative.

To adjust the virtual memory swap file

  1. In the System option in Control Panel, click the Performance tab.
  2. Click the Virtual Memory button.
  3. To specify a different hard disk, click the option named Let Me Specify My Own Virtual Memory Settings. Then specify the new disk in the Hard Disk box. Or, type values (in kilobytes) in the Minimum or Maximum boxes. Then click OK.

If you set the maximum swap file size in the Virtual Memory dialog box to the amount of free space currently on a drive, Windows 95 assumes that it can increase the swap file beyond that size if more free disk space becomes available. If you want to impose a fixed limit on the swap file size, make sure that the limit you choose is less than the current maximum.