Dynamic Virtual Memory Swap Files in Windows 98

Microsoft Windows 98 managed virtual memory by replacing the rigid, user-configured swap files of earlier operating systems with a fully dynamic Virtual Memory Manager (VMM). Instead of requiring a permanent, contiguous block of hard drive space, Windows 98 monitored system memory pressure in real time, automatically expanding and shrinking a single swap file named WIN386.SWP on the host drive as application demands shifted.

The Role of the Virtual Memory Manager (VMM32)

The subsystem responsible for swap file allocation in Windows 98 was the Virtual Memory Manager, embedded within the 32-bit core driver architecture (VMM32.VXD). The VMM implemented a 32-bit, flat-model memory architecture using 4-kilobyte memory pages.

When physical RAM filled up, the VMM analyzed active memory pages using a Least Recently Used (LRU) paging algorithm. Inactive code and data were marked for eviction to the hard drive, freeing physical RAM for foreground processes.

Dynamic Growth and Shrinking Mechanism

By default, Windows 98 was configured to "Let Windows manage my virtual memory settings." Under this configuration, the swap file functioned dynamically through specific behaviors:

  1. On-Demand Allocation: Unlike Windows 3.1, which required dedicated, contiguous disk clusters set up in advance, Windows 98 treated WIN386.SWP as a standard file managed through the FAT16 or FAT32 file systems. When total committed memory exceeded physical RAM, the VMM issued file system calls to append new clusters to WIN386.SWP.
  2. Drive Space Awareness: The VMM continuously polled the host drive's free space. It calculated a safety threshold to prevent the swap file from consuming all remaining storage, which would crash the operating system or active applications.
  3. Contraction During Low Demand: When applications closed and allocated memory was released, the VMM reclaimed the dirty pages. Once these pages were invalidated, the manager initiated background trimming routines that truncated the physical size of WIN386.SWP, returning unneeded disk clusters back to the general file system.

Disk Fragmentation and Performance Trade-offs

Because Windows 98 dynamically allocated non-contiguous clusters across the hard drive, dynamic expansion frequently resulted in disk fragmentation. As the drive fragmented, writing and reading pages slowed down, leading to noticeable hard drive thrashing.

To mitigate this, power users often overridden the dynamic defaults in the System Properties control panel. Setting the minimum and maximum swap file sizes to the exact same value forced Windows 98 to treat the file as a fixed size, preventing the dynamic allocation routines from fragmenting the drive during heavy workloads.