How MS-DOS 6.22 MemMaker Optimizes System RAM

The MS-DOS 6.22 MemMaker utility automatically optimizes system memory by relocating device drivers and terminate-and-stay-resident (TSR) programs out of conventional memory and into Upper Memory Blocks (UMBs). By analyzing system startup files, measuring the memory requirements of each program, and testing optimal placement configurations through automated reboots, MemMaker maximizes the amount of free conventional memory (the first 640 KB of RAM) available for running DOS-based software and games.

The Conventional Memory Problem

MS-DOS architecture historically limits executable applications to the first 640 kilobytes (KB) of system RAM, known as conventional memory. Hardware drivers (such as CD-ROM drivers or mouse software) and background utilities routinely consume this limited space. The region between 640 KB and 1024 KB, known as the Upper Memory Area (UMA), was reserved for system hardware such as video adapters and BIOS ROMs, often leaving unused gaps. MemMaker automates the process of utilizing these unused gaps to free up conventional memory.

Prerequisites: HIMEM.SYS and EMM386.EXE

Before MemMaker can optimize memory, it requires the extended memory manager (HIMEM.SYS) and the expanded memory emulator (EMM386.EXE) installed on an Intel 80386 or later processor. HIMEM.SYS provides access to extended memory (RAM above 1 MB), while EMM386.EXE maps portions of that extended memory into the unused physical address gaps in the Upper Memory Area, transforming them into usable Upper Memory Blocks (UMBs).

Step 1: Configuration and Driver Assessment

When executed, MemMaker provides the option of an "Express" or "Custom" setup (which allows the user to specify whether programs need Expanded Memory (EMS)). MemMaker then creates backups of the existing CONFIG.SYS, AUTOEXEC.BAT, and system initialization files, naming the backups with a .UMB extension.

Next, it inserts a temporary tracking utility called SIZER.386 into CONFIG.SYS before each driver and program. MemMaker then prompts for a system restart.

Step 2: Measuring Memory Overhead During Reboot

During the reboot, SIZER.386 intercepts each driver in CONFIG.SYS and each TSR loaded in AUTOEXEC.BAT. It records two critical metrics for each program:

  1. Execution Size: The maximum amount of memory the program requires during initialization.
  2. Resident Size: The final, static amount of memory the program occupies once it has fully loaded.

Because many drivers require more memory to initialize than to remain resident, calculating both sizes is essential to avoid system crashes when loading them into tight memory blocks.

Step 3: Calculating the Optimal Memory Fit

Once MS-DOS loads back to the command prompt, MemMaker reads the data collected by SIZER.386. It maps out the available UMB fragments identified by EMM386.EXE and calculates an optimal layout.

Because Upper Memory Blocks are typically fragmented rather than one contiguous block, MemMaker uses an optimization algorithm to determine the order in which drivers should load. It calculates which programs should go into which specific memory regions, ensuring that initialization peaks do not overflow available block boundaries.

Step 4: Modifying Startup Files

After determining the best configuration, MemMaker rewrites CONFIG.SYS and AUTOEXEC.BAT:

  • Drivers in CONFIG.SYS are converted from DEVICE= to DEVICEHIGH=. MemMaker adds parameters like /L: (region load switches) to direct specific drivers into specified UMB memory regions and define the minimum initialization space.
  • Executables in AUTOEXEC.BAT are prepended with LOADHIGH (or LH), also including explicit memory region parameters where necessary.

Step 5: Verification and Finalization

MemMaker reboots the computer a final time to execute the new configuration. Upon restart, it verifies that all drivers and TSRs successfully loaded into upper memory and asks the user to confirm that the system is functioning properly. If the system fails to boot or becomes unstable, running MEMMAKER /UNDO restores the original, unedited configuration files from the backups.