here is a sample tested in delphi 2005 or 2006:

vcl form with two tbuttons, toracledataset (ods), tdatasource (ds), toraclesession (os):

procedure TForm1.Button1Click(Sender: TObject);
begin
if ods.Active then ods.Close else ods.open;
{ the same with active true/false }
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ods.refresh;
end;
{ refresh has the biggest memory consumption }
or try
procedure TForm1.Button2Click(Sender: TObject);
begin
ods.first;
while not ods.eof do
begin
inc(c);
ods.RefreshRecord;
ods.next;
end;
end;

when you hit button2 about 10/20 times you can see memory increasing in the task manager.
refresh is very obvious, refreshrecord less

when you connect a dbgrid with the datasource the memory increment can be about 16k per click.

i played with compiler directives, i tried delphi 2005 and 2006 on two machines and all the same.
since i need to refresh my db data very often its really a problem because when the application runs about 8 hours it takes about 1gb of memory !

thanks in advance for your help :-)

claus reinhardt


Claus Reinhardt

Inforent GmbH
Stephanstrasse 3
60313 Frankfurt am Main
Germany