Subject | Re: [IBO] Memory leak: More info |
---|---|
Author | Dennis McFall |
Post date | 2002-08-10T18:09:45Z |
I created a standalone, single-form Delphi application, for which this is
the entire code. The form has three components: an IB_Connection, an
IB_Transaction and an IB_Cursor, whose SQL property is 'SELECT FIRSTNAME,
LASTNAME FROM PERSONS WHERE NAME_OID < 120000':
Through a series of clicking Button1 (curTest.Open, Close, Unprepared) and
Button2 (FreeList), the MemUsage in Task Manager increases by about 600 KB
on the first Button1Click, and that figure never goes back to where it was
when the application first loaded, even though curTest is closed and the
Transaction is committed.. But, on the other hand, that figure does not
increase with subsequent clicks on Button1 (unlike in my application, where
MemUsage keeps on going up by 10MB every time I click Button1.).
Base application MemUsage: 2224 MB
After Button1Click: 2808
After Button2Click (free list): 2600
After Button1Click: 2792
After Button2Click: 2600
After Button1Click: 2808
After Button2Click: 2616
After Button1Click: 2808
After Button2Click: 2616
procedure TForm1.Button1Click(Sender: TObject);
begin
aList := TStringList.create;
with curTest do try
if not prepared then prepare;
First;
if not eof then while not eof do begin
aList.Add(Fields[0].AsString + ' ' + Fields[1].AsString);
Next;
end;
finally
Close;
Unprepare;
Transaction1.Commit;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
aList.Clear;
aList.Free;
end;
Dennis McFall
the entire code. The form has three components: an IB_Connection, an
IB_Transaction and an IB_Cursor, whose SQL property is 'SELECT FIRSTNAME,
LASTNAME FROM PERSONS WHERE NAME_OID < 120000':
Through a series of clicking Button1 (curTest.Open, Close, Unprepared) and
Button2 (FreeList), the MemUsage in Task Manager increases by about 600 KB
on the first Button1Click, and that figure never goes back to where it was
when the application first loaded, even though curTest is closed and the
Transaction is committed.. But, on the other hand, that figure does not
increase with subsequent clicks on Button1 (unlike in my application, where
MemUsage keeps on going up by 10MB every time I click Button1.).
Base application MemUsage: 2224 MB
After Button1Click: 2808
After Button2Click (free list): 2600
After Button1Click: 2792
After Button2Click: 2600
After Button1Click: 2808
After Button2Click: 2616
After Button1Click: 2808
After Button2Click: 2616
procedure TForm1.Button1Click(Sender: TObject);
begin
aList := TStringList.create;
with curTest do try
if not prepared then prepare;
First;
if not eof then while not eof do begin
aList.Add(Fields[0].AsString + ' ' + Fields[1].AsString);
Next;
end;
finally
Close;
Unprepare;
Transaction1.Commit;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
aList.Clear;
aList.Free;
end;
Dennis McFall