Memory Leak Using TMyConnection and TMyQuery

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fdf
Posts: 1
Joined: Sat 08 Apr 2006 15:29

Memory Leak Using TMyConnection and TMyQuery

Post by fdf » Tue 09 May 2006 05:58

I am creating a connection and query at runtime. The query fires a lot. There is unquestionably a memory leak in the lower level procedure and I have tested all of the other components for leaks, without success. So I am trying to figure out if TMyQuery is the problem.

I'm a pretty new user of MyDAC so I'm figuring there is something obvious I am missing. I urgently need help on this as it is a key part in a project that needs to be delivered soon.

Thanks

Frank

Here is pseudocode that captures the MyDAC parts of the routine:

Code: Select all

ProcedureA(.  . .);
var
Connect: TMyConnection;
I: Integer;
begin try
  Connect := TMyConnection.Create(Self)
  //configure the connection and open it

  For I := 0 to 200000 do begin
    ProcedureB(Connect, . . . );
    //store results of call
    end;

  finally
    Connect.Free;
  end;

ProcedureB(Connect: TMyConnection, . . . );
var
  Q: TMyQuery;
begin try
  Q := TMyQuery.Create(nil);
  Q.Connection := Connect;
  
  With Q do begin
    //Add strings to the SQL property
    Open;
    // Store the results in local data structures
    Close;
    end;

  finally
    Q.Free
  end;
  end;
[/list]

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 11 May 2006 09:20

We have wrote a sample using code from the letter you have sent, but no memory leak was found. Try downloading last version of MyADC (4.30.0.12). If problem persists then, make a simple application to demonstrate this problem, including script to create and fill table. Also supply us following information:
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor

Albert van Pelt
Posts: 11
Joined: Wed 06 Jan 2010 16:48
Location: Eindhoven

memory leak

Post by Albert van Pelt » Mon 15 Feb 2010 15:59

Was the memory leak solved ?

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Wed 17 Feb 2010 09:06

We have fixed this problem in the latest MyDAC build (5.90).

Post Reply