home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
MEM_OS2.ZIP
/
MEM_OS2.TXT
< prev
Wrap
Text File
|
1988-08-16
|
2KB
|
41 lines
MEM_OS2.ARC
MEM_OS2.EXE is a more sophisticated version of OS2MEM.EXE, a
program that I wrote earlier this year which displays the results of a
call to the the API function DosMemAvail.
This new version is uses the multitasking ability of OS/2 to
bring up a number of threads which execute concurrently and enable the
user to more closely monitor the memory demands of the system.
The first thread repeatedly updates and displays the value
returned by DosMemAvail, dynamically both as a number and on a bar graph.
The second thread displays the time. The third of the concurrent
threads polls keyboard to see if the escape key is pressed by the user.
I set the priority for these threads quite low (they run as
background processes) although the program is begun normally from the
command line, _not_ as a detached process. In this way I avoided having
to use pop-ups, as I consider them too abrupt to be asthetically pleasing,
and I decreased the load on the processor from the running threads.
The program is begun by entering its name on the command line or
selecting it from the Program Selector. It pulls up the threads, which
continue to run until the user presses ESC. As you load additional
programs, you can switch back to MEM_OS2.EXE and see how the memory load
has changed downward; as you terminate programs, you can watch the available
memory increase. With MEM_OS2.EXE running in the forground, the memory
usage of any background processes or other screen groups is dynamically
displayed.
Although DosMemAvail is described as a snapshot approach, I have
found that the value returned closely tracks the actual memory available
to the system, because the OS/2 MMU apparantly tries to keep rebuilding the
largest memory block available when a program frees up some memory it was
using.
This program was developed on a no-name AT clone w/3mg Ram, using
MSC 5.1 and IBM OS/2 ver 1.0.
If you have any questions about any of this, contact me at
CompuServe 72261,347.
Harve Schiffman
8-03-88