Dec 302017
Tell largest block of available memory under OS/2 (full screen only).
File OS2MEM.ZIP from The Programmer’s Corner in
Category OS/2 Files
Tell largest block of available memory under OS/2 (full screen only).
File Name File Size Zip Size Zip Type
INF.FIL 2194 822 deflated
MEM.EXE 4374 2415 deflated
MEMORY.DOC 2339 1127 deflated

Download File OS2MEM.ZIP Here

Contents of the MEMORY.DOC file


The OS/2 operating system has most of the same utilities as DOS 3.3,
including CHKDSK, but they work differently in some cases. In the case of
the CHKDSK utility, it was often used to return the amount of free memory
left in the 640K user work area, so that the user would know when he was run-
ning out of memory.
The CHKDSK utility under OS/2 does check the disk, but it no longer
returns the free memory left to the user. There are probably many reasons for
this, but I think that the main one was a public relations type of manage-
ment decision to emphasize the break with the past (DOS) that OS/2
represented to Microsoft. The company view is that since the operating system
actively manages memory, and theoretically will not let the user run out of
memory (it swaps to disk when the ram runs low), there is no reason for the
user to worry about how much 'free' memory he has left. They feel that if the
user notices that his programs are running slowly, that he has only to buy and
install more ram chips if he wants, or to close out some programs to give the
others more processor time.
This patronizing view toward users results in the truncated CHKDSK
utility, and makes it difficult for the user to avoid 'over-committing' memory.
Thus, I wrote this small program which calls the DosMemAvail function
of the OS/2 API. This function returns into a doubleword field the largest
(unallocated) memory segment in the system. It gives you a snapshot view of
the amount of free memory available to the operating system; it can (and often
does) change dynamically from moment to moment, but it is a valid figure from
which you can estimate the amount of memory would be optimal for the system.
The mimimun free memory required for OS/2 to load a new program is 384 K bytes.
You should note that the figure apparantly represents the largest con-
tiguous block of free memory: if you have started and exited several sessions,
there may be free non_contiguous blocks that would be available to the OS but
which would not be reflected in the figure returned by DOSMEMAVAIL. Thus
the figure shown by this program is an approximation of the free memory, not
the exact amount.

Harve Schiffman
Upland, Ca 1988

Harve Jay Schiffman
Upland, Ca 1988

 December 30, 2017  Add comments

Leave a Reply