[bug_report] PostgreSQL memory leaks

In this forum all bug reports concerning the 6.x branch will be gahtered. You have the possibility to track the bug fix process.

Moderators: EgonHugeist, mdaems

Post Reply
jose
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 11.12.2006, 16:10

[bug_report] PostgreSQL memory leaks

Post by jose »

Environ
ide: Lazarus-0.9.20 beta
Compiler: freepascal 2.0.4
DBO: 6.6.0 beta

if i execute the following code, the amount of memory required by the process grows ever

procedure TForm1.Button1Click(Sender: TObject);
var
q: tzquery;
begin
while true do
begin
q:=TZQuery.Create(nil);
q.Connection:=ZConnection1;
q.SQL.Text:='select codiarti,descarti from articoli where codiarti = ''25''';
q.open;
sleep(1);
application.ProcessMessages;
q.Close;
q.free;
end;
end;

the memory doesn't grow if i change the query executed this way

q.SQL.Text:='select codiarti from articoli where codiarti = ''25''';

I extract one field instead of two or more.

Can it be a bug?

Thank's in advance for any answare.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,

This problem MAY BE solved in current SVN Trunk version since november 11.

There was a problem cleaning column info when more than 1 column was selected.

Check if your version contains this code :

Code: Select all

procedure TZAbstractResultSet.Close;
  var I : integer;
  var FColumnInfo : TZColumnInfo;
begin
  LastWasNull := True;
  FRowNo := 0;
  FLastRowNo := 0;
  FClosed := True;
  for I := FColumnsInfo.Count-1 downto 0 do begin
    FColumnInfo:=TZColumnInfo(FColumnsInfo.Extract(FColumnsInfo.Items[I]));
    FColumnInfo.Free;
  end;
  FColumnsInfo.Clear;
  FStatement := nil;
end;
Mark Daems

BTW, please answer if this solves your problem.
jose
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 11.12.2006, 16:10

Post by jose »

Hi,
I installed the svn trunk rev 187, patched as above, but this doesn't solved the problem.
thank's in advance for any help.
Post Reply