memory leak

We were struggling some time, looking for a memory leak in our data access application. Oddly enough, nobody had the same problem (no one posted it), so we couldn't imaging, that the cause was in the DOA code.

Now we found something in the oracledata.pas. the changes i made were solving our problems, maybe they are helpful for others too.
I inserted 2 lines to free the TLOBLocator and the LOBList. My additional lines ar marked with the "// rb, ..." comments.

function TOracleDataSet.PSExecuteStatement(const ASQL: string; AParams: TParams;
ResultSet: Pointer = nil): Integer;
...

// Write the LOB's
if Result > 0 then for l := 0 to LOBList.Count - 1 do
begin
LOB := LOBList[l];
s := AParams[LOB.Tag].AsBlob;
if Length(s) > 0 then
begin
if LOB.LOBType = otCLOB then s := RemoveCR(s, Session);
LOB.Write(s[1], Length(s));
end;
// rb, 19.06.2006, memleack
LOB.free;
end;
// rb, 19.06.2006, memleack
LOBList.Free;
except
on E:Exception do
begin

...

But maybe the changes are stupid and someone could help me to find the right solution.

Regards,
Ralf
 
It seems that this is indeed a memory leak. The LOB's and the list are only freed in case of an exception. We have fixed this for the next release.
 
Hi Marco,

did you have a timeframe for a next release?

There are a lot of bugfixes in the last time, and no release :-( :-(

Greetings
Jens
 
We'll have a beta for 4.1 available later this week, which adds Unicode support and includes this particular fix.
 
Back
Top