How Windows 3.11 Handled Virtual Memory Paging

Microsoft Windows 3.11 utilized the hardware capabilities of the Intel 80386 processor to implement virtual memory through demand-paged swap files, enabling systems with limited RAM to run memory-intensive applications. By running in 386 Enhanced Mode, the operating system divided physical memory and hard drive space into uniform 4-kilobyte pages, automatically swapping inactive memory segments to disk to free up physical RAM for active processes. This architecture allowed users to run multiple applications simultaneously, even on machines with as little as 4 megabytes of physical memory.

386 Enhanced Mode and Paged Memory

Virtual memory in Windows 3.11 was only functional when running in 386 Enhanced Mode. This mode unlocked the protected-mode features of Intel 80386 and later processors, including hardware-level memory management and 4 KB memory paging.

The system maintained a page table that mapped virtual addresses used by programs to physical locations. When an application requested memory that exceeded physical capacity, the Virtual Memory Manager (VMM) identified pages in RAM that were not currently in use, wrote their contents to the hard drive, and reallocated the freed RAM to the requesting application. If the original program needed its data back, the processor triggered a page fault, prompting Windows to read the page back from disk into RAM, often swapping out a different page in the process.

Temporary vs. Permanent Swap Files

To store evicted memory pages, Windows 3.11 relied on swap files, which came in two distinct varieties:

  • Permanent Swap Files (386SPART.PAR): A permanent swap file occupied a fixed, contiguous block of disk sectors. Because the sectors were sequential, Windows bypassed standard MS-DOS file system overhead and accessed the disk sectors directly. This configuration yielded the fastest paging performance and was recommended for systems with severely restricted RAM. However, it required unfragmented disk space and could not shrink or grow dynamically.
  • Temporary Swap Files (WIN386.SWP): A temporary swap file was created when Windows started and deleted upon exit. While it preserved disk space when Windows was not running and tolerated fragmented drives, it was significantly slower. The operating system had to communicate through the MS-DOS file system to locate disparate sectors across the disk drive, noticeably degrading performance during heavy paging.

32-Bit Disk Access and Performance

Paging memory to a mechanical hard drive introduced a significant performance bottleneck, particularly on systems with 4 MB or 8 MB of RAM. To mitigate this latency, Windows 3.11 introduced 32-Bit Disk Access (FastDisk).

FastDisk allowed the Virtual Memory Manager to communicate directly with supported Western Digital and IDE drive controllers via a protected-mode device driver (*wdctrl), completely bypassing MS-DOS and the system BIOS. This eliminated the CPU-costly context switches between protected mode and 16-bit real mode during paging operations, drastically reducing disk read and write times while swapping pages.

Challenges with Low-RAM Configurations

On machines with minimal physical memory, running several multitasking applications frequently resulted in "disk thrashing." Thrashing occurred when the operating system spent more CPU cycles swapping pages back and forth between physical RAM and the swap file than executing actual program instructions. While Windows 3.11 effectively prevented out-of-memory crashes on limited hardware, maintaining a properly sized permanent swap file and enabling 32-bit disk access were critical to ensuring the system remained responsive under low-memory conditions.