Kbase P13898: Memory leak using TEMP-TABLEs as parameters to internal procedures.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Verified
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
SYMPTOM(s):
Memory leak
Running a program that uses static TEMP-TABLEs
TEMP-TABLEs are passed as a parameter to an internal procedure
Parameter is defined as PARAMETER TABLE-HANDLE
CAUSE:
The PARAMETER TABLE-HANDLE created when the internal procedure is called is not deleted automatically by Progress when the internal procedure terminates. The following reproduces the behavior mentioned:
DEFINE VARIABLE i AS INTEGER NO-UNDO.
DEFINE TEMP-TABLE ttCust
FIELD custnum AS INTEGER.
DO i = 1 TO 1000:
RUN test (INPUT-OUTPUT TABLE ttCust).
END.
PROCEDURE test:
DEFINE INPUT-OUTPUT PARAMETER TABLE-HANDLE hTt.
END.
FIX:
The PARAMETER TABLE-HANDLE must be deleted before returning to the calling procedure. Therefore:
PROCEDURE test:
DEFINE INPUT-OUTPUT PARAMETER TABLE-HANDLE hTt.
DELETE OBJECT hTt.
END.
This also applies when the TABLE-HANDLE is passed as an INPUT and as an OUTPUT parameter.