You will often see this error when you try to run a large DOS program for the first time. Fixing this error is in fact a fun part of playing with emulators.

Examine Memory Usage

Use mem.exe to examine how the memory is used up by the system.

C:> mem /c /p

Here is a typical output:

It will show you how much memory is used by each program/driver.

Free up memory

There are two places that you should look into: CONFIG.SYS and AUTOEXEC.BAT.

In config.sys, there may be a lot of "DEVICE=" lines. Comment out unimportant lines except the one:

DEVICE=HIMEM.SYS /testmem:off
DOS=HIGH

Make sure these two lines are present, and you usually can disable others. For example, if you don't need to use the CDROM, then you should just comment out it.

For the same reason, you can check AUTOEXEC.BAT and make sure you have a minimal set up.

Use Expanded Memory Manager

When you have done your best and yet the error persists. Then you should try to use expanded memory manager(EMM). Note that some games require EMM to run, and some can't run with EMM enabled. You must know how to enable and disable EMM.

Enable EMM

EMMSTUB.SYS is the expanded memory driver for Aemula. Please download it and put it under the C:.

Add the following line to CONFIG.SYS:

DEVICE=C:\EMMSTUB.SYS

By default, Aemula emulates 1MB expanded memory. If that is not enough, you can change it by editing the configure file init.l. Find the following code:

(ems-init '(
             (size . #x100000)
           ))

To get 4MB expanded memory, you should change it to:

(ems-init '(
             (size . #x400000)
           ))

You can also use other utilities like EMM386.EXE. They uses the extended memory ( outside 1MB area ) to emulate expanded memory.

Disable EMM

Comment out the line in CONFIG.SYS:

REM DEVICE=C:\EMMSTUB.SYS