Page 1 of 1

Memory Leak Using TMyConnection and TMyQuery

Posted: Tue 09 May 2006 05:58
by fdf
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]

Posted: Thu 11 May 2006 09:20
by Antaeus
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

memory leak

Posted: Mon 15 Feb 2010 15:59
by Albert van Pelt
Was the memory leak solved ?

Posted: Wed 17 Feb 2010 09:06
by Dimon
We have fixed this problem in the latest MyDAC build (5.90).