OS/2 Freeware

SQZMEM.CMD v1.00b

AUTHOR: Andrew McElroy (RIME OS/2 Conference NODE "->MIDAS") ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ

PURPOSE: Cause RAM Compression under OS/2 2.x.

NOTES: - The program will report a size that the swap file grew to when it ends. However, the swap file may actually grow larger after the program reports it's findings. This is normal. - Before running this program, you should be sure there is sufficient room for the swap file to grow by approximate 2-6MB. - The location of the swapper file MUST be customized for each system in  order for this to work. This is done because on some systems, there can be more than one SWAPPER.DAT file due to not deleting the old one after changing CONFIG.SYS to point to a new location. -- This program is placed in the public domain. However, if you modify it, I request that you add your name after mine in the author field before distribution.



SwapPath="F:\OS2\SYSTEM\SWAPPER.DAT";

call RxFuncAdd 'SysFileTree', 'RexxUtil', 'SysFileTree'; call RxFuncAdd 'SysCls',     'RexxUtil', 'SysCls'; call RxFuncAdd 'SysSleep',   'RexxUtil', 'SysSleep';

call SysCls; SAY 'SQZMEM Starting...' call SysFileTree SwapPath, 'save', 'F';

if save.0 = 1 then do  PARSE VAR save.1 SaveDate SaveTime SaveSize SaveAttr SavePath; SAY SavePath 'started at' SaveSize; end else do  SAY ; SAY 'ERROR:' SwapPath 'was not found.'; SAY ; SAY ' SQZMEM.CMD must be customized to point to the location'; SAY ' of your swapper.dat file. Edit SQZMEM.CMD and change the'; SAY ' location specified in the SwapPath variable.'; CALL BEEP 524,125; exit(0); exit (1); end

DO outer=1 to 999 DO inner = 1 to 1000 x.outer.inner = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456"; end inner call SysFileTree SwapPath, 'file', 'F'  PARSE VAR file.1 FileData FileTime FileSize FileAttr FilePath; say 'At iteration' outer', swapper.dat is' FileSize if SaveSize \= FileSize then do     say FilePath '   grew to' FileSize; call RxFuncDrop 'SysFileTree'; call RxFuncDrop 'SysCls'; call RxFuncDrop 'SysSleep'; exit (0); end call SysSleep 1; end outer; SAY 'Efficient RAM compression through swap file usage did not occur.' call RxFuncDrop 'SysFileTree' call RxFuncDrop 'SysCls' Exit (2);