/* memmon.cmd - memory monitor */ /* a wrapper for above512 to monitor memory usage */ /* use control+c to stop monitoring */ /* pm = private memory */ /* sm = shared memory */ /* left entries display memory below 512 */ /* right entries display memory above 512 */ /* DB - added logging */ out = 0 curline = "" first_string = "" call rxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs" call SysLoadFuncs SIGNAL ON HALT /* termine program with CONTROL+C */ previous='' do forever '@ABOVE512 2>nul | rxqueue 2>NUL 1>&2' call SysSleep 1 do while queued() <> 0 curLine = lineIN( "QUEUE:" ) if out = 0 then do parse var curLine first_string . if first_string = "current" then out = 1 else out = 0 end else do parse var curline val.1 . val.2 . . . val.3 . val.4 . output= " pm:" val.1 "sm:" val.2 " <---512---> pm:" val.3 "sm:" val.4 if output\=previous then do previous=output output= date() time()" - pm:" val.1 "sm:" val.2 " <-512-> pm:" val.3 "sm:" val.4 say output rc=lineOut("Above512Mon.log",output) rc=stream("Above512Mon.log",'c','close') end out = 0 end end end exit HALT: exit