Ibquery create and free memory

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Ibquery create and free memory

Post by calou » Wed 09 Dec 2009 14:49

Hello,

I do this code :

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
query: TIBCQuery;
tranc: TIBCTransaction;
begin
  query:= TIBCQuery.Create(self);
  query.AutoCommit:= false;

  tranc:= TIBCTransaction.Create(self);
  tranc.DefaultConnection:= IBCConnection1;

  query.Transaction:= tranc;

  query.Connection:= IBCConnection1;
  query.SQL.Text:= 'SELECT * FROM data_10min';
  query.Open;

  if tranc.Active = true then begin
    tranc.Rollback;
  end;

  tranc.Free;
  query.Free;

end;
My problem is when i click on the button the RAM increase by 1M and when i call the free method the 1M are not freed (seen in the task manager)

Thanks for help

Regards

uko
Posts: 14
Joined: Tue 16 Sep 2008 12:27

Post by uko » Wed 09 Dec 2009 16:12

Hello,

have you tried to use FastMMs debug options to see if there is a real memory leak? (also for older Delphi versions available).


best regards,
Ulrich

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 11 Dec 2009 08:50

This may occur because Delphi memory manager does not return memory to the operating system. When an application frees a memory block, this block is returned to the memory manager and is marked as free. Memory manager may not return this block to the operating system. It reserves this block for the future use.

calou
Posts: 116
Joined: Tue 27 May 2008 12:46

Post by calou » Fri 11 Dec 2009 10:38

Thanks plash for the answer

Post Reply