Document 1305
MEMORY USE

Description:

When using the EMM386.SYS device driver, you may notice that the
MEM command can display a memory report that seems to show more
memory available than exists on your computer. For example,
consider the following EMM386.SYS device driver line on a
computer with 3,072 Kbytes of Extended memory:

DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO /K=AUTO /B=FFFF /R=AUTO

This line has the effect of converting all Extended memory into
Extended via XMS and EMS (expanded) memory. The resulting MEM
report might show that the computer has 3,072 Kbytes of Extended
memory and 3,072 Kbytes of EMS memory under the "Total Bytes"
column, with 2,864 Kbytes of Extended via XMS memory and 2,864
Kbytes of EMS memory under the "Available" column as shown below.

        | Memory Type -------- Total ---------- Available ---|
        |                  |                |                |
        | Conventional     |    (    60K )  |    (   626K )  |
        | Upper            |    (    96K )  |    (    79K )  |
        | High             |    (    64K )  |    (    18K )  |
        | Extended         |    ( 3,072K )  |    (     0K )  |
        | Extended via XMS |        N/A     |    ( 2,864K )  |
        | EMS              |    ( 3,072K )  |    ( 2,864K )  |
        |----------------------------------------------------|

        

To understand this, it might be helpful to view the total
Extended memory available on a computer as comprising a dynamic
pool of memory. This memory can be viewed as dynamic because it
is available to be accessed either as Extended via XMS memory or
as EMS (expanded) memory depending on the "/K" setting on the
EMM386.SYS device driver. In the case shown above, "/K=AUTO"
tells EMM386.SYS to allow ALL of the Extended memory pool to be
accessed as Extended via XMS memory and EMS memory in equal
portions. The MEM command therefore shows both amounts of memory
as being available because you or your applications might want
to use a portion or all of the memory pool as either Extended
via XMS memory or EMS memory. The "/K" switch can be used to put
a limit on the amount of EMS memory to be created from the total
memory pool. The following EMM386.SYS device driver line on the
same computer with 3,072 Kbytes of Extended memory will limit
the amount of EMS memory to be created from the total memory
pool by setting the "/K" option to "/K=1024":

DEVICE=C:\DRDOS\EMM386.SYS /F=AUTO /K=1024 /B=FFFF /R=AUTO

This line will still cause EMM386.SYS to convert all of the
memory pool into Extended via XMS, but it will limit the amount
of EMS to 1,024 Kbytes. The resulting MEM report might show that
the computer has 3,072 Kbytes of Extended memory and 1,024
Kbytes of EMS memory under the "Total Bytes" column, with 2,864
Kbytes of Extended via XMS memory still available but only 896
Kbytes of EMS memory under the "Available" column as shown below.

        | Memory Type -------- Total ---------- Available ---|
        |                  |                |                |
        | Conventional     |    (   640K )  |    (   626K )  |
        | Upper            |    (    96K )  |    (    79K )  |
        | High             |    (    64K )  |    (    17K )  |
        | Extended         |    ( 3,072K )  |    (     0K )  |
        | Extended via XMS |        N/A     |    ( 2,864K )  |
        | EMS              |    ( 1,024K )  |    (   896K )  |
        |----------------------------------------------------|

You will notice in both of the above examples, that there is a
difference between the "Total Bytes" of Extended memory and the
"Available" bytes of Extended via XMS memory and a similar
difference between the "Total Bytes" of EMS memory and the
"Available" bytes of EMS memory. This is due to the amount of
"overhead" memory used by the EMM386.SYS software to convert the
memory pool into both types of available memory.

XMS memory is extended memory created by memory management
software which conforms to the XMS specification developed by
Lotus, Intel, and Microsoft. The DR DOS memory management
software device driver (EMM386.SYS) fully supports this
specification and, as a result, initially converts ALL of the
computer's available extended memory into XMS extended memory.
This is the reason that there is no "Extended" memory listed in
the "Available" column of the DR DOS MEM report; it has all been
converted to XMS memory by the EMM386.SYS device driver. This is
also the reason why Extended via XMS lists as "N/A" under the
"Total Bytes" column; XMS memory is created by a software device
driver and is not present at boot time.

Note:  EMS memory is listed with a specific value under the
"Total Bytes" column by the MEM report unlike the Extended via
XMS listing. EMS memory can be created by a software device
driver (like EMM386.SYS alone) or can be created by EMS (LIM
4.0) hardware memory boards and their accompanying device
driver. This specific value is intended to reflect this EMS
memory created by the "/K" option on the EMM386.SYS device
driver line or "hardware" EMS memory created by certain
platforms, typically non- 386/386sx/486 platforms, which  
actually contain EMS (LIM 4.0) hardware.
