How to Optimize MS-DOS 6.22 Memory with LOADHIGH

This article explains how the LOADHIGH (or LH) command optimizes memory usage in MS-DOS 6.22 by shifting resident programs out of conventional memory and into Upper Memory Blocks (UMBs). You will learn how the command operates, the prerequisites required in your system configuration to enable it, and the practical steps to maximize free conventional memory for resource-heavy DOS applications.

The 640 KB Conventional Memory Challenge

MS-DOS operates under a real-mode memory architecture where conventional memory is strictly capped at the first 640 kilobytes (KB). Standard DOS applications, especially complex games and databases, require as much contiguous conventional memory as possible to run. By default, device drivers loaded via CONFIG.SYS and Terminate-and-Stay-Resident (TSR) programs loaded via AUTOEXEC.BAT consume portions of this 640 KB space, leaving insufficient memory for primary applications.

How LOADHIGH Works

The LOADHIGH command instructs MS-DOS 6.22 to load a specified TSR program into the Upper Memory Area (UMA)—the region between 640 KB and 1024 KB (1 MB). Normally reserved for hardware BIOS, video memory, and network adapters, unused portions of this area can be converted into usable space called Upper Memory Blocks (UMBs).

When you prefix an executable with LOADHIGH (or its abbreviated form LH), the operating system tests whether an available UMB has sufficient contiguous space to house the program. If enough space exists, DOS allocates that memory region to the TSR. If the program requires more space than any single UMB can provide, DOS automatically falls back to loading the program into conventional memory, preventing execution failure.

Required Prerequisites in CONFIG.SYS

LOADHIGH cannot function on its own; it relies on memory managers configured during the initial boot sequence. For MS-DOS 6.22 to create and manage UMBs on an Intel 80386 or later processor, your CONFIG.SYS file must include the following directives in this specific order:

DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE NOEMS
DOS=HIGH,UMB
  • HIMEM.SYS: Manages extended memory (XMS) and enables the High Memory Area (HMA).
  • EMM386.EXE: Maps physical extended memory addresses into unused regions of the UMA, creating the UMBs. Using the NOEMS switch maximizes the available UMB space if Expanded Memory (EMS) is not required; alternatively, use RAM if EMS is needed.
  • DOS=HIGH,UMB: Instructs MS-DOS to move its own core kernel into the HMA (HIGH) and enables management of Upper Memory Blocks (UMB).

Practical Usage in AUTOEXEC.BAT

Once UMB support is active, common TSR utilities can be relocated out of conventional memory within AUTOEXEC.BAT. Typical examples include mouse drivers, keyboard utilities, and caching software:

LH C:\DOS\DOSKEY.COM
LH C:\MOUSE\MOUSE.COM
LH C:\DOS\SMARTDRV.EXE

Advanced users can target specific memory regions using the /L switch to define region numbers, controlling the exact loading order and layout of TSRs to eliminate memory fragmentation.

Verifying and Maximizing Results

You can verify memory optimization by running the built-in diagnostic tool:

MEM /C /P

This displays a classified summary of all programs currently loaded in both conventional and upper memory. If configured properly, utilities loaded via LOADHIGH will appear in the upper memory columns, yielding 600 KB to 620 KB of free conventional memory to ensure compatibility with demanding DOS software.