[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: OpenEdge 11.6 | How to find a memory leak on AppServer

Status
Not open for further replies.
G

gus bjorklund

Guest
> On May 15, 2019, at 5:18 AM, atuldalvi123 wrote: > > only input output temp tables and datasets and temp tables & datasets are simple not with handle object based on what you have said, it is likely that you are creating tem-tables and dataasets that are not being deleted when you don't need them anymore. if you start client with -clientlog foo -logentrytype "temp-tables:4" then this code (admittedly crude) might be helpful and that you can use along with client-logging: /* this program matches up temp-table create and delete log messages. generated by the 4gl runtime clientlog facility. -clientlog foo.log -logentrytype "temp-tables:4" just cat your foo.log log files as generated by the 4GL into tt_all.log. version 6, gus bjorklund, december 15, 2014. */ using Progress.Database.TempTableInfo. def var deb as logical no-undo initial false. def var input1 as char no-undo. def var input2 as char no-undo. def var data_op as char no-undo. def var data_name as char no-undo. def var data_path as char no-undo. def var data_line as char no-undo. def var n as int no-undo. def var m as int no-undo. def var nmatches as int no-undo. def var entries as int no-undo. /* here we collect info about the orphans a row is added for each create. the row is eliminated when we see a delete */ def temp-table ttorphans no-undo field tt_op as character field tt_name as char field tt_path as char field tt_line as char index ix1 tt_name. /* here we collect tt name and number of creates and deletes for each one */ def temp-table ttcounts no-undo field theName as char field path as char field creates as int field deletes as int index ix1 theName. /* read log entries for tt creates and deletes */ input from tt_all.log. inloop: repeat: import unformatted input1. trim (input1). /* skip the stuff we don't want */ if (index (input1, "TEMP-TABLE") if (index (input1, "Created") data_op = entry (11, input1, " "). data_name = entry (13, input1, " "). if (index (input1, ")") > 0) then do: input2 = substring (input1 , index (input1, ")") + 1). data_path = entry (2, input2, " ") no-error. data_line = entry (4, input2, " ") no-error. if deb then display data_op format "x(1)" data_name format "x(25)" data_path format "x(30)" data_line format "x(6)" . end. if (data_op <> "Created") and (data_op <> "Deleted") then next inloop. entries = entries + 1. if (entries mod 25000) = 0 then display entries. if (entries > 1000000) then leave. find ttcounts where theName = data_name no-error. if not available ttcounts then do: create ttcounts. assign theName = data_name path = data_path creates = 0 deletes = 0 . end. if (data_op = "Created") then creates = creates + 1. else deletes = deletes + 1. find first ttorphans where (data_name = tt_name) and (tt_op <> data_op) no-error. if available ttorphans then do: /* have matching tt , get rid of old, drop new */ nmatches = nmatches + 2. delete ttorphans. next inloop. end. /* no match, so add a new record */ create ttorphans. assign tt_op = data_op tt_name = data_name tt_path = data_path tt_line = data_line . end. message entries " records read," nmatches " matched". output to nodelete.txt. for each ttcounts where (creates > 0) and (deletes <> creates): put theName format "x(20)" (creates - deletes) skip. end. output close. n = 0. m = 0. output to nodelete2.txt. for each ttorphans: put tt_path format "x(30)" tt_name format "x(30)" skip. if tt_op = "Created" then n = n + 1. if tt_op = "Deleted" then m = m + 1. end. output close. message n " creates and " m " deletes don't match". def var tableCount as int no-undo. def var procName as char no-undo. def var infoHandle as handle no-undo. repeat n = 1 to TempTableInfo:TempTableCount: TempTableInfo:GetTableInfoByPosition (n, infoHandle, procName). display infoHandle:name procName. end.

Continue reading...
 
Status
Not open for further replies.
Top