Memory issue
Posted: 26.11.2009, 15:43
Hi there,
I'm experiencing a strange memory behaviour using the following code. The table is holding about 400.000 records:
//----------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
aQuery: TZQuery;
begin
aQuery := TZQuery.Create(nil);
aQuery.Connection := G_DBConnection;
try
aQuery.SQL.Text := 'SELECT * FROM table1234;';
aQuery.Open;
try
while not aQuery.EOF do
begin
// ...
aQuery.Next;
end;
finally
aQuery.Close;
end;
// ...
finally
aQuery.Free;
end;
end;
//----------------------------------------------------------------------
I'm using ZEOSDBO-6.6.4-stable under Delphi 7, the database is postgreSQL 8.4.0.1.
The memory increases massively by calling "aQuery.Next" and is never totally released (only when you close the application).
One should think that if you call "aQuery.Next" on an already cached ResultSet the memory doesn't increase much further, but it does.
FastMM is reporting no memory leaks though...
Any ideas?
Thanks in advance!
I'm experiencing a strange memory behaviour using the following code. The table is holding about 400.000 records:
//----------------------------------------------------------------------
procedure TForm1.Button1Click(Sender: TObject);
var
aQuery: TZQuery;
begin
aQuery := TZQuery.Create(nil);
aQuery.Connection := G_DBConnection;
try
aQuery.SQL.Text := 'SELECT * FROM table1234;';
aQuery.Open;
try
while not aQuery.EOF do
begin
// ...
aQuery.Next;
end;
finally
aQuery.Close;
end;
// ...
finally
aQuery.Free;
end;
end;
//----------------------------------------------------------------------
I'm using ZEOSDBO-6.6.4-stable under Delphi 7, the database is postgreSQL 8.4.0.1.
The memory increases massively by calling "aQuery.Next" and is never totally released (only when you close the application).
One should think that if you call "aQuery.Next" on an already cached ResultSet the memory doesn't increase much further, but it does.
FastMM is reporting no memory leaks though...
Any ideas?
Thanks in advance!