MAPMEM and RAMFREE

Prev Next Home Home Table Of Contents Index

MAPMEM and RAMFREE

These two utilities provide status information about DOS memory usage. They don't make active changes to the system like RELEASE and DISABLE do.

MAPMEM.EXE displays a map of DOS memory. It shows the resident programs, how much memory they use, and the interrupt vectors which each one controls. MAPMEM also shows information about expanded and extended memory, when available.

MAPMEM writes to the standard output -- hence, the output can be printed or stored to a file by using DOS redirection.

Here is an example of MAPMEM output:

MAPMEM 3.2, Copyright 1991 TurboPower Software


 Psp  Cnt   Size Name       Command Line        Hooked Vectors
 ---- --- ------ ---------- ------------------- ----------------------
       2  74,704 DOS
 1240  2   3,296 4DOS                           2E
       1      80 ---free---
 1316  1     464 MODE
 133B  2   9,216 DESKPOP    /k /x /1            05 08 09 13 16 25 26 28
 157F  2   3,296 TPE                            1B
 164F  3   3,328 4dos       /e /x /u            22 23 24 2F
 1722  2 560,736 ---free---
         655,360 ---total--

EMS Memory 0000 16,384 n/a 770,048 ---free--- 1,048,576 ---total--

XMS Memory 0001 409,600 n/a 0002 266,240 n/a 0003 73,728 n/a 0004 568,320 n/a 0005 22,528 n/a 35,840 ---free--- 1,376,256 ---total--

"Psp" stands for Program Segment Prefix. This is the physical address, specified in hexadecimal, where the program was loaded. If you're running DOS 2.x, you'll need to use an address from this column to pass to DISABLE.

"Cnt" is the number of memory blocks DOS is using to manage the program. This will typically be two: one for the program itself and another for the environment that stores the program name, the DOS path, and other environment variables.

"Size" is the number of bytes of memory, specified in decimal, allocated to the program.

The "Name" column shows the name of the program that allocated the block. An "n/a" in this column means either that the program deallocated its environment to reduce memory usage or that the system is running DOS 2.x, where the owner names are simply not available. Note that, under MS-DOS 5.0, an alternate method allows MAPMEM to find the TSR name even if it deallocated its environment.

"Command line" shows the command line entered when the TSR was originally loaded. Some TSR's overwrite their command line with other code or data in order to save memory space. MAPMEM can usually detect this behavior and will display "n/a" in the command line column when it does.

The last column will be titled as either "Chained vectors" or "Hooked vectors". When WATCH is loaded, "Chained" will appear; otherwise, "Hooked" will. The numbers in this column indicate what interrupt vectors the TSR has grabbed. Without WATCH, MAPMEM must use a heuristic technique to identify the owner of each vector. Don't be surprised if you see some ridiculous looking vector numbers. With WATCH, MAPMEM should report an accurate list for each TSR, and should show the complete chain of control for each interrupt.

MAPMEM indicates disabled TSR's by displaying the word "disabled" in the interrupt vector column of the report.

MAPMEM displays free memory blocks with the notation "---free---", and the total amount of memory in a particular region with the notation "---total--".

On systems running a compatible memory manager, MAPMEM will also contain a section reporting memory used in the region between 640K and 1 megabyte. This section is interpreted just like the one for lower memory. Because of the lack of complete standards for managing high memory, the names and attributes of programs in high memory may sometimes appear garbled. Unfortunately, there is little we can do about this without building features specific to particular memory managers into the TSR Utilities.

The expanded memory report shows each allocated block of expanded memory, as well as the free and total EMS space. If a program has assigned a name to an EMS memory block, that name will appear adjacent to the block size.

Similarly, when an XMS (extended) memory driver such as HIMEM.SYS is loaded, MAPMEM reports the blocks of allocated extended memory. A name is never available for XMS memory.

If extended memory is available and no HIMEM driver is loaded, MAPMEM will report the free and total amount of raw extended memory. These numbers can be misleading because some applications allocate extended memory by making it appear that the memory is no longer installed on the system.

MAPMEM offers the following command line options:


     /C name  check whether TSR "name" is loaded.
     /E       report expanded (EMS) memory.
     /F       report free areas only.
     /H       do not use WATCH information for vectors.
     /L       do not report low memory.
     /Q       write no screen output with /C option.
     /S       show summary of all memory areas.
     /U       report upper memory blocks if available.
     /V       verbose report.
     /X       report extended (XMS) memory.
     /?       write this help screen.

You can also put the string MAPMEM=options in the DOS environment. For example, if you type


    SET MAPMEM=/U/E

at the DOS command line, MAPMEM will use the /U and /E options as the defaults thereafter.

When /C is specified, MAPMEM does not produce its normal report. Instead, it simply checks to see whether the named TSR is currently in memory. MAPMEM then writes an appropriate screen message, and also sets the DOS ERRORLEVEL so that a batch file can detect the results. MAPMEM returns errorlevel 2 if the TSR isn't loaded, 1 if there was a syntax error, and 0 if the TSR is in memory. Note that this option does *not* require WATCH to be loaded. MAPMEM does not check high memory unless the /U option is also specified. It does not check low memory if the /L option is specified.

/E causes MAPMEM to generate its expanded memory report.

/F causes MAPMEM to report just the free areas in normal, high, expanded, and extended memory.

/H causes MAPMEM to report "hooked" vectors, even if WATCH is loaded.

/L causes MAPMEM to omit reporting low memory (memory below 640K) and also prevents it from searching low memory when the /C option is used. Specifying /L also automatically sets the same flag controlled by /U. /L has no effect when /F or /S is specified.

/Q prevents MAPMEM from writing any screen output. This option is only meaningful in combination with the /C option.

/S generates a "summary" report. The report shows just the size, name, and command line of each program in conventional memory, including any free blocks. It also shows the free and total memory for EMS and XMS.

/U causes MAPMEM to write information about high memory (upper memory blocks, those above 640K).

/V generates a verbose report instead of the standard report about normal and high memory. In this case, MAPMEM shows each individual memory block rather than just one for each program. It also adds two new columns of information. "Mcb" stands for Memory Control Block. This is a physical address, expressed in hexadecimal, of the DOS data structure used for managing each block of memory. The MCB address is typically one less than the address of the program. "Files" reports the number of files kept open by the TSR. In most cases this will be zero, in which case the corresponding column of the report is left blank. When it is non-zero, the maximum number of files opened by the rest of the programs (including the foreground application) is reduced accordingly.

When /V is active, MAPMEM also reports the memory allocation of each DOS device driver under DOS 5. It also shows details of memory associated with the interrupt vector table, the BIOS data area, and various DOS data areas.

RAMFREE.COM is a tiny program with a single purpose: to tell you how many bytes of memory are free for the next application. The number it reports is the same as that reported by (some versions of) the DOS CHKDSK utility. RAMFREE's advantage is that you don't need to wait for your hard disk to be analyzed before you find out how much memory is free.

Prev Next Home Home Table Of Contents Index

Sponsors
Shopping
Forum
Forum
email
EMail
Index
Index
Home
Home