Microsoft KB Archive/49741

EMM386 Memory Usage PSS ID Number: Q49741 Article last modified on 01-22-1993 PSS database name: O_MSDOS

4.00 4.01

MS-DOS

Summary:

EMM386 can report results for memory usage that may not make sense to some users if they don’t understand how EMM386 works. EMM386 uses an extra 48K of extended memory in addition to the amount needed for emulating expanded memory. Also, EMM386 always allocates memory in such a way that at least 64K of extended memory remains free. Finally, EMM386 appears to allocate an extra 384K of system memory in addition to the amount that you would expect for extended memory. An explanation of EMM386 memory usage is listed below.

More Information:

For example, consider the following statement in a CONFIG.SYS file:

device=emm386.sys 256

For simplification, assume that the machine is equipped with only 256K of extended memory. EMM386 will attempt to allocate 256K of extended memory to be used in emulating expanded memory. The following is reported when EMM386 installs itself:

144K Extended Memory Allocated 384K System Memory Allocated

-

528K Expanded Memory Available This report can be confirmed by using the MEM command from MS-DOS, which displays the following information:

262,144 Total Extended Memory 65,536 Available Extended Memory

540,672 Total EMS Memory 147,456 Free EMS Memory

Note that even though EMM386 has requested 256K of extended memory, it only ended up with 144K. This is because 48K is consumed as overhead by EMM386 and 64K is reserved for the XMS driver, HIMEM.SYS. Therefore, only 256K - (64K + 48K) = 144K is left for EMS emulation.

EMM386 also reports that 384K of system memory is allocated when it loads, and the MEM command reports a total of 528K (384K + 144K) of EMS memory. This is because EMM386 [a LIM 4.00 Expanded Memory Manager (EMM)] has the ability to implement large-frame EMS. In this configuration, part of the conventional memory addressing area can be used by EMM386 for mapping page frames. The LIM 4.00 specification allows up to 384K of conventional addressing area to be used by an EMM. Therefore, the system is reporting that at any given time EMM386 can use up to 384K of conventional addressing area for large-frame EMS.

Additional reference words: 4.00 4.01 noupd

Copyright Microsoft Corporation 1993.