home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / OS2MEM.ZIP / MEMORY.DOC < prev   
Text File  |  1988-04-29  |  2KB  |  43 lines

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