Kbase P149324: 4GL/ABL: Writing a fixed number of bytes to a MEMPTR variable takes varying periods of time.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  14/07/2009 |
|
Status: Unverified
SYMPTOM(s):
4GL/ABL: Writing a fixed number of bytes to a MEMPTR variable takes varying periods of time.
In tests, writing 12410 bytes to MEMPTR variable takes 147 ms while writing the same 12410 bytes to the same MEMPTR variable takes 526 ms
Executing the following code, generates a mylog.txt file which shows that writing 31990 bytes to a MEMPTR VARIABLE occasionally increase to more than double or the average time:
DEFINE VARIABLE mMempointer AS MEMPTR NO-UNDO.
DEFINE VARIABLE iPtrPosition AS INTEGER NO-UNDO.
DEFINE VARIABLE iOuterLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE iInnerLoop AS INTEGER NO-UNDO.
DEFINE VARIABLE iRepeatCount AS INTEGER NO-UNDO.
DEFINE VARIABLE iTimeElapsed AS INTEGER NO-UNDO.
OUTPUT TO mylog.txt.
DO iOuterLoop = 1 TO 1000:
SET-SIZE(mMempointer) = 31992.
iRepeatCount = 31990.
ETIME(YES).
iPtrPosition = 1.
DO iInnerLoop = 1 TO iRepeatCount:
PUT-BYTE(mMempointer,iPtrPosition) = 67.
iPtrPosition = iPtrPosition + 1.
END.
SET-SIZE(mMempointer) = 0.
iTimeElapsed = ETIME.
PUT UNFORMATTED iTimeElapsed SKIP.
END.
OUTPUT CLOSE.
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.1C
OpenEdge 10.1C03 Service Pack
CAUSE:
Operating system memory management.
FIX:
The occasional variation in the time needed to perform a given loop is normal and is attributable to operating system memory management and / or other CPU requests at the time.