Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#770 Using a "SysAddRexxMacro"ed script eats memory

v4.0
closed
Rick McGuire
5
2012-08-14
2009-07-19
DougL
No

The script below reports a few things and then repeatedly calls the attached "ProbSize_callee" script. It pauses every 1,000 calls so you can use Task Manager to check how much memory is being consumed.
ProbSize_callee is simply a "return" statement followed by 1,000 copies of a "a = b + c" statement.

If ProbSize_callee is not macro loaded, a small bit of memory gets consumed per 1,000 calls, perhaps due to some fragmentation.
But if it is loaded into memory via SysAddRexxMacro, about 84 bytes gets permanently added each call (not each 1,000).

If the "a = b + c" statements are all removed from ProbSize_callee, must less memory is consumed per call.
Also, the process does the same amount of work as before (executing 1 return statement per call) but runs much faster, which also doesn't seem right since the callee should be sitting in memory..

Running REXX-ooRexx_4.0.0(MT) 6.03 15 Jul 2009 in up-to-date Vista.

The caller ...

    if '' == SysQueryRexxMacro('ProbSize_callee') then
      say '  * ProbSize_callee is not macro loaded'
    else
      say '  * ProbSize_callee is macro loaded'

    say '  * Process id is' SysQueryProcess('pid')

    do ii = 1
      if ii // 1000 == 0 then do
        call charout , '  * Did' (ii / 1000)'k calls -- Press enter to continue: '
        call linein
        end
      call ProbSize_callee 1
      end

    exit

Discussion


Anonymous


Cancel   Add attachments