Consultor Eletrônico



Kbase P113170: How to detect stray dynamic TEMP-TABLEs.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/16/2008
Status: Verified

GOAL:

How to detect those dynamic TEMP-TABLEs that have not been deleted.

GOAL:

How to find out which dynamic TEMP-TABLEs linger in memory.

GOAL:

How to find out which dynamic TEMP-TABLEs might cause memory leaks.

GOAL:

How to find out which dynamic TEMP-TABLEs might cause the client DBI file to grow unexpectedly.

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Versions

FIX:

In order to help you check whether you might have dynamic TEMP-TABLEs in the clients memory which have not been properly deleted (be it created by the application, or implicitly by Progress), you can run the following code at a point in which you think that there should be few or no dynamic TEMP-TABLEs:
DEFINE VARIABLE hBuffer AS HANDLE NO-UNDO.
OUTPUT TO "memdump.log" APPEND.
PUT UNFORMATTED SKIP
"** Dump: " TODAY STRING(TIME,'HH:MM:SS') SKIP
"** Dynamic temp-tables **" SKIP.
ASSIGN hBuffer = SESSION:FIRST-BUFFER.
DO WHILE VALID-HANDLE(hBuffer):
IF VALID-HANDLE((hBuffer:TABLE-HANDLE)) THEN DO:
PUT hBuffer:TABLE-HANDLE:NAME FORMAT "x(20)" AT 2
" ".
&IF PROVERSION BEGINS "1" &THEN
IF VALID-HANDLE(hBuffer:INSTANTIATING-PROCEDURE) THEN
PUT hBuffer:INSTANTIATING-PROCEDURE:FILE-NAME FORMAT "x(40)".
&ENDIF
PUT SKIP.
END.
hBuffer = hBuffer:NEXT-SIBLING.
END.
OUTPUT CLOSE.
In the file memdump.log you will find the names of the dynamic TEMP-TABLEs currently in memory; you can check for any unwanted TEMP-TABLEs there. In OpenEdge, the name of the program that created the TEMP-TABLE will also be output.