[ The PC Guide | System
Optimization and Enhancement Guide | System Optimizations and
Enhancements | Conventional and Upper Memory Optimization ]
Maximize Conventional Memory Under DOS (and Windows)
There are several common techniques that can be used to maximize the amount of free
conventional memory in the DOS environment. These apply to Windows 3.x as well, since it
runs on top of DOS, and most of the ideas apply to Windows 95 as well. In addition,
Windows 95 has some of its own quirks, which are discussed in this section.
DOS programs are the ones that are most sensitive to conventional memory concerns,
because normal ones cannot access more than the conventional memory area (where Windows
programs can use megabytes of extended memory). In addition, under DOS you do not have the
advantage of being able to use Windows drivers in extended memory, which makes
conventional memory even harder to come by for DOS programs.
Note: In all of the
instructions below, I assume that Windows is located in the C:\WINDOWS directory. If yours
is somewhere else, make the appropriate change.
Tip: Use this DOS command to
check memory usage and the amount free: "MEM /C /P".
Here are some ideas that I suggest for maximizing conventional memory. Not all of these
may apply to you, but using as many of them as possible should leave you with a large
amount of free conventional memory. I can almost always get over 600 KB of free memory on
any system using these techniques:
- Reduce Driver and Memory-Resident Program Use: The biggest reason why people run
out of conventional memory is that they use too much of it for unnecessary drivers and
memory-resident programs. Examine your CONFIG.SYS and AUTOEXEC.BAT files and remove lines
that call programs you don't really need. The best way to do this is to insert the
characters "REM " in front of the line. This makes the line into a
"remark". The command is not executed, but it is still present in the file for
easy undoing if removing the command causes a problem.
- Use HIMEM.SYS and the High Memory Area for DOS: The high memory area is the first
64 KB of the extended memory area; due to a quirk in the design of DOS, it is the only
part of extended memory that can be accessed by regular DOS programs. The most efficient
way to use it is by telling DOS to load itself into that area, instead of conventional
memory. Do this by adding these two lines to CONFIG.SYS, at the top:
"DEVICE=C:\WINDOWS\HIMEM.SYS" and "DOS=HIGH,UMB".
Tip: If you have a version of
DOS whose HIMEM.SYS does that annoying memory check at startup, slowing down the boot
process, add "/TESTMEM:OFF" at the end of the HIMEM.SYS line to disable it, if
you want.
- Use EMM386.EXE and the Upper Memory Area: This system program enables the use of upper memory blocks (parts of the upper memory
area). These blocks can be used for drivers and other programs that load when the system
is booted, so that these are not taking up valuable conventional memory. The EMM386
program is what enables the use of these blocks. You will want to add the following line
in your CONFIG.SYS file, under the HIMEM.SYS line:
"DEVICE=C:\WINDOWS\EMM386.EXE". You will then need to add one or more parameters
to the line depending on how you are using your system; see below.
- Disable Expanded Memory: EMM386.EXE enables access to the upper memory blocks but
also to so-called "expanded memory". The difference between extended and
expanded memory is a bit confusing, so see here if
you want the full description; the short version is that expanded memory is a
different way of using your extended memory that most people do not need. If you don't
need expanded memory (and any program that still needs it today would be explicit about
this need since it's unusual) then disable the EMS buffer by adding the "NOEMS"
parameter on the EMM386 line. This will free up a full 64 KB of upper memory blocks for
your use.
- Enable the Use of the Monochrome Video Area: By default, EMM386.EXE will not
allow you to use the 32 KB upper memory block from B0000h to B7FFFh, because this is
reserved for the monochrome text display area. Older PCs used this area to display black
and white text, but today's PCs display even monochrome text using a color text mode. So
unless you are using ancient software on an ancient PC, you can tell EMM386 to use this
area for drivers. Just add "I=B000-B7FF" to the end of the EMM386.EXE line in
the CONFIG.SYS file. This will save up to 32 KB of conventional memory.
Warning: Watch out for problems
with older applications that use monochrome text if you use this trick, and be prepared to
undo it. Frankly, I've only ever seen one PC that had a problem with it--it was running a
ten-year-old CAD program.
- Use DEVICEHIGH and LOADHIGH: Once you have loaded EMM386.EXE in your CONFIG.SYS
file, the upper memory area is enabled and can be used by other device drivers or small
programs. To load a driver that is in your CONFIG.SYS file--for example, a CD-ROM
driver--into the upper memory area, change the start of its line from "DEVICE="
to "DEVICEHIGH=". To load a program in the AUTOEXEC.BAT file into the upper
memory area, prefix the command with LOADHIGH or LH (a short form). So if before you
loaded your DOS mouse driver with the command "C:\MOUSE\MOUSE.EXE", now you
would have "LOADHIGH C:\MOUSE\MOUSE.EXE". Good candidates for DEVICEHIGH and
LOADHIGH include: CD-ROM drivers, mouse drivers, compression drivers
(DoubleSpace/DriveSpace) and any other small programs that you load from your system
files.
- Reduce the Number of FILES and BUFFERS: DOS lets you set the number of file
handles and buffers that it will use, through the FILES and BUFFERS commands in
CONFIG.SYS. Reduce these to conserve a small amount of conventional memory, but be careful
because making them too low can cause programs to malfunction. I usually use 100 and 40,
respectively.
- Eliminate Disk Compression: Using disk compression requires that a driver be
loaded at all times in memory, to handle compression and decompression when the compressed
volume is used. If you are considering getting rid of the compression on your system for
performance reasons, another reason is that you can eliminate the driver and save
conventional memory. If you are going to use compression, at least load the driver
using the DEVICEHIGH command; but if you are using Windows 95, see here because the situation is more complicated.
Here's what a typical CONFIG.SYS file would look like, incorporating the ideas above.
My own CONFIG.SYS looks a fair bit like this. You might find it useful to use the
following as a template and adjust it to the needs of your system setup:
- DEVICE=C:\WINDOWS\HIMEM.SYS
- DEVICE=C:\WINDOWS\EMM386.EXE NOEMS I=B000-B7FF
- DEVICEHIGH={insert other drivers here, such as a CD-ROM driver if appropriate}
- DOS=HIGH,UMB
- FILES=100
- BUFFERS=40
- BREAK=ON
- LASTDRIVE=Z
Next: Maximize
Conventional Memory Under Windows 95
Home - Search
- Topics - Up
|