jschmied
Member²
I've been hit badly by a huge memory leak wiht the following code:
FOracleObject := TOracleObject.Create(FSession, FSchema + '.O_AXMLDATAIN', '');
SetComplexVariable('DATA', FOracleObject);
Execute;
FCount := FOracleObject.ElementCount;
// Read Object Attributes (1..n RefElement)
for i := 1 to FCount - 1 do begin
with FOracleObject.RefElements.Pin(poLatest, plNone) do begin
try
XMLString := LOBAttr('XMLDATA').AsString;
FNR := GetAttr('NODE');
finally
Free();
end;
end;
end;
// Write Object Attributes (0. RefElement)
with FOracleObject.RefElements[0].Pin(poAny, plExclusive) do begin
try
LOBAttr('XMLDATA').AsString := FResultString;
SetAttr('NODE_VERSION', FVersionsNr);
Flush();
finally
Free();
end;
end;
if assigned(FOracleObject) then FreeAndNil(FOracleObject);
-------------
SQL: Statement
:RET:=READJOB
TIMEOUT,:TIMELEFT,
ATA,
ARAMETER,:ERROR_TEXT);
-------------
PL/SQL Function:
FUNCTION ReadJob (
n_queue_timeout IN INTEGER,
n_product_time_left OUT INTEGER,
axmldata_in OUT o_aXmlDataIn,
parameter OUT CLOB,
s_error_text OUT VARCHAR2
)
RETURN INTEGER IS
...
SELECT xmldata_in INTO axmldata_in FROM cycle_data;
-------------
Types:
CREATE OR REPLACE TYPE o_aXmlDataIn AS VARRAY(32) OF REF o_XmlDataOut;
CREATE OR REPLACE TYPE o_XmlDataOut AS OBJECT
(
node VARCHAR2(32),
xmldata CLOB
...
);
per execution i loose about 10 KB of memory. Memproof shows no leaks
within the code but some not freed memory deep in th oracle layer called
by both pin methods. Stangely a simple logoff/logon frees the memory.
Any solutions????
Thanks
Juergen
FOracleObject := TOracleObject.Create(FSession, FSchema + '.O_AXMLDATAIN', '');
SetComplexVariable('DATA', FOracleObject);
Execute;
FCount := FOracleObject.ElementCount;
// Read Object Attributes (1..n RefElement)
for i := 1 to FCount - 1 do begin
with FOracleObject.RefElements.Pin(poLatest, plNone) do begin
try
XMLString := LOBAttr('XMLDATA').AsString;
FNR := GetAttr('NODE');
finally
Free();
end;
end;
end;
// Write Object Attributes (0. RefElement)
with FOracleObject.RefElements[0].Pin(poAny, plExclusive) do begin
try
LOBAttr('XMLDATA').AsString := FResultString;
SetAttr('NODE_VERSION', FVersionsNr);
Flush();
finally
Free();
end;
end;
if assigned(FOracleObject) then FreeAndNil(FOracleObject);
-------------
SQL: Statement
:RET:=READJOB



-------------
PL/SQL Function:
FUNCTION ReadJob (
n_queue_timeout IN INTEGER,
n_product_time_left OUT INTEGER,
axmldata_in OUT o_aXmlDataIn,
parameter OUT CLOB,
s_error_text OUT VARCHAR2
)
RETURN INTEGER IS
...
SELECT xmldata_in INTO axmldata_in FROM cycle_data;
-------------
Types:
CREATE OR REPLACE TYPE o_aXmlDataIn AS VARRAY(32) OF REF o_XmlDataOut;
CREATE OR REPLACE TYPE o_XmlDataOut AS OBJECT
(
node VARCHAR2(32),
xmldata CLOB
...
);
per execution i loose about 10 KB of memory. Memproof shows no leaks
within the code but some not freed memory deep in th oracle layer called
by both pin methods. Stangely a simple logoff/logon frees the memory.
Any solutions????
Thanks
Juergen