-------------------------- MS-DOS v6.22 Help: MEM --------------------------
<Notes> <Examples>                                               <Index>
----------------------------------------------------------------------------

                                    MEM

Displays the amount of used and free memory on your computer.

You can use the MEM command to display information about allocated memory
areas, free memory areas, and programs that are currently loaded into
memory.

Syntax

    MEM [/CLASSIFY|/DEBUG|/FREE|/MODULE modulename] [/PAGE]

To display the status of your computer's used and free memory, use the
following syntax:

    MEM

Switches

/CLASSIFY
    Lists the programs that are currently loaded into memory and shows how
    much conventional and upper memory each program is using. MEM /CLASSIFY
    also summarizes overall memory use and lists the largest free memory
    blocks. You can use the /CLASSIFY switch with /PAGE but not with other
    MEM switches. You can abbreviate /CLASSIFY as /C.

/DEBUG
    Lists the programs and internal drivers that are currently loaded into
    memory. MEM /DEBUG shows each module's size, segment address, and module
    type, summarizes overall memory use, and displays other information
    useful for programming. You can use the /DEBUG switch with /PAGE but not
    with other MEM switches. You can abbreviate /DEBUG as /D.

/FREE
    Lists the free areas of conventional and upper memory. MEM /FREE shows
    the segment address and size of each free area of conventional memory,
    and shows the largest free upper memory block in each region of upper
    memory. You can use the /FREE switch with /PAGE but not with other MEM
    switches. You can abbreviate /FREE as /F.

/MODULE programname
    Shows how a program module is currently using memory. You must specify
    the program name after the /MODULE switch. MEM /MODULE lists the areas
    of memory the specified program module has allocated and shows the
    address and size of each area. You can use the /MODULE switch with
    /PAGE, but not with other MEM switches. You can abbreviate /MODULE as
    /M.

/PAGE
    Pauses after each screen of output. This switch can be used with any of
    the other MEM switches.

Related Command

For information about checking the amount of space available on a disk, see
the <CHKDSK> command.

                                      ***

<Syntax> <Examples>
----------------------------------------------------------------------------

                                 MEM--Notes

Specifying the /PAGE switch automatically

You can use the DOSKEY program to automatically add the /PAGE switch to the
MEM command. Then, each time you use MEM, it will pause after each screenful
of information even if you don't type the /P switch on the MEM command line.
To do this, add the following commands to your AUTOEXEC.BAT file:

    c:\dos\doskey
    doskey mem=mem.exe $* /p

Displaying memory status

MS-DOS displays the status of extended memory only if you have installed
memory above the 1-megabyte (MB) boundary in your system. MS-DOS displays
the status of expanded memory only if you use expanded memory that conforms
to version 4.0 of the Lotus/Intel/Microsoft Expanded Memory Specification
(LIM EMS). MS-DOS displays the status of the upper memory area only if a UMB
provider such as EMM386 is installed and the command DOS=UMB is included in
the CONFIG.SYS file. MS-DOS does not display the status of the upper memory
area if you issue the MEM command while you are running Windows version
3.0.

Allocating extended memory

To allocate Interrupt 15h memory and XMS memory at the same time, use the
/INT15 switch when you load the HIMEM.SYS device driver.

For more information, see <HIMEM.SYS>.

                                      ***

<Syntax> <Notes>
----------------------------------------------------------------------------

                               MEM--Examples

Getting general program and memory information

Suppose your system has both expanded memory and extended memory. To display
a summary of your system's total memory--conventional, expanded, extended,
and upper--and to display a list of programs currently loaded into memory,
type the following command:

    mem /classify

The results might look similar to the following:

Modules using memory below 1 MB:

  Name           Total       =   Conventional   +   Upper Memory
  --------  ----------------   ----------------   ----------------
  SYSTEM      16,477   (16K)     16,461   (16K)         16    (0K)
  SETVER         784    (1K)        784    (1K)          0    (0K)
  HIMEM        1,168    (1K)      1,168    (1K)          0    (0K)
  EMM386       3,120    (3K)      3,120    (3K)          0    (0K)
  USPI14       9,120    (9K)      9,120    (9K)          0    (0K)
  COMMAND      3,680    (4K)      3,680    (4K)          0    (0K)
  SMARTDRV    37,680   (37K)     21,280   (21K)     16,400   (16K)
  MOUSE       17,088   (17K)     17,088   (17K)          0    (0K)
  NETBEUI     42,432   (41K)     41,760   (41K)        672    (1K)
  REDIR       86,064   (84K)     76,128   (74K)      9,936   (10K)
  ANARKEY     14,384   (14K)          0    (0K)     14,384   (14K)
  ZPOWER       4,368    (4K)          0    (0K)      4,368    (4K)
  ANSI         4,208    (4K)          0    (0K)      4,208    (4K)
  DRVSPACE    36,848   (36K)          0    (0K)     36,848   (36K)
  PROTMAN        128    (0K)          0    (0K)        128    (0K)
  EXP16        9,056    (9K)          0    (0K)      9,056    (9K)
  WORKGRP      4,368    (4K)          0    (0K)      4,368    (4K)
  RAMDRIVE     1,312    (1K)          0    (0K)      1,312    (1K)
  Free       472,464  (461K)    464,448  (454K)      8,016    (8K)

Memory Summary:

  Type of Memory       Total   =    Used    +    Free
  ----------------  ----------   ----------   ----------
  Conventional         655,360      190,912      464,448
  Upper                109,712      101,696        8,016
  Reserved             393,216      393,216            0
  Extended (XMS)    15,618,928   12,424,048    3,194,880
  ----------------  ----------   ----------   ----------
  Total memory      16,777,216   13,109,872    3,667,344

  Total under 1 MB     765,072      292,608      472,464

  Largest executable program size        464,352   (453K)
  Largest free upper memory block          7,888     (8K)
  MS-DOS is resident in the high memory area.

"Reserved" is the memory located on add-on boards such as video adapter
boards. "Largest executable program size" is the largest contiguous block of
conventional memory available for a program. "Largest free upper memory
block" is the largest area of upper memory available for a program. "MS-DOS
is resident in the high memory area" indicates that MS-DOS is running in the
first 64K of extended memory rather than in conventional memory.

Getting information about a specific program

To find out what memory a specific program module has allocated, use the MEM
/MODULE command. For example, to find out what memory the WIN386 module has
allocated, you would type the following command:

    mem /module win386

If you were running WIN386, the results might look similar to the
following:

WIN386 is using the following memory:

  Segment  Region       Total        Type
  -------  ------  ----------------  --------
   0081D                 80    (0K)  Data
   02EF8                384    (0K)  Environment
   02F10             89,856   (88K)  Program
   0D4D0       1         96    (0K)  Data
   0D611       1      7,888    (8K)  Data
   0EFFE       2         32    (0K)  Data
                   ----------------
  Total Size: 98,336   (96K)

Some program modules, such as WIN386, allocate more than one area of memory.
The MEM /MODULE command displays all the areas of memory allocated by the
specified program, and shows the segment address and size of each
allocation. For upper memory blocks, MEM /MODULE also shows the region
number. The Type column shows how the program is using that particular area
of memory. The "total size," in this case 98,336 bytes (96K), shows the
total amount of memory allocated by MS-DOS for the specified program.

                                      ***

----------------------------------------------------------------------------
<Top of page>
Last update: December 07, 2002 14:45 by
Content © 1997 Microsoft Corporation
All else © 2000-2005
Counter