ODAC v6.70 TOraSession:Connect/Disconnect causes memory leak

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Vitaliy_S
Posts: 3
Joined: Thu 06 Nov 2008 09:29

ODAC v6.70 TOraSession:Connect/Disconnect causes memory leak

Post by Vitaliy_S » Thu 06 Nov 2008 09:56

Hi,

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
begin
  OraSession1:= TOraSession.Create(nil);
  OraSession1.Username:='sys';
  OraSession1.Password:='xxxxxxxxxxx';
  OraSession1.Server:='192.168.1.8:1521:TESTDB';
  OraSession1.ConnectMode:=cmSysDBA;
  OraSession1.Options.Direct:=true;
    while True do
    begin
      OraSession1.Connect;
      OraSession1.Disconnect;
    end;
end;
TOraSession Connect/Disconnect causes memory leak, if running Form1 minimize - memory free, which is visible in taskmanager.
I've test it with ODAC v6.50(Trial) and v6.70(Trial), Delphi 2007. Oracle server 10.2.0.4, oracle client not installed.

P.S. Sorry for my bad English.

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

Post by Plash » Fri 07 Nov 2008 08:37

We could not reproduce the problem. Please send to odac*devart*com a complete small sample that demonstrates the problem, including the script for creating database objects.

Vitaliy_S
Posts: 3
Joined: Thu 06 Nov 2008 09:29

Post by Vitaliy_S » Fri 07 Nov 2008 10:05

We could not reproduce the problem ?
Ok, simple example:

Code: Select all

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Ora, DB, OraClasses, DBAccess;

type
  TForm1 = class(TForm)
    Button1: TButton;
    OraSession1: TOraSession;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  OraSession1.Username:='sys';
  OraSession1.Password:='xxxxxxxx';
  OraSession1.Server:='192.168.1.8:1522:TESTDB';
  OraSession1.ConnectMode:=cmSysDBA;
  OraSession1.Options.Direct:=true;
    for i:=1 to 1000 do
    begin
      OraSession1.Connect;
      OraSession1.Disconnect;
    end;
end;
end.
Before procedure executing memory usage - 4436 kb, after procedure executing - 17057 kb (look the windows tasks manager).
1000 operations connect/disconnect - use 12 616kb of the RAM. Why?

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

Post by Plash » Mon 10 Nov 2008 09:00

Please do the following test to detect if a memory leak occurs:
1. Replace the loop in your program with the following:

Code: Select all

    while True do
    begin
      OraSession1.Connect;
      OraSession1.Disconnect;
    end;
2. Run the application; open Task Manager; go to the Processes tab, and find your application in the list. See if the value in the Mem Usage column increases or it remains on the same level.

Vitaliy_S
Posts: 3
Joined: Thu 06 Nov 2008 09:29

Post by Vitaliy_S » Mon 10 Nov 2008 09:22

Memory usage increases at each operation Connect/Disconnect by 4-12 kb. :(

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

Post by Plash » Wed 03 Dec 2008 08:39

If you install AQTime or similar program to detect memory leaks, we can send you a test application compiled with debug information. Then you can run this application in AQTime to see the place where the memory leak occurs.

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Thu 04 Dec 2008 10:44

Hi Oleg,

i have AQTime installed and you can send me the project also.

So i can verify it also, if needed.

Greetings
Jens

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

Post by Plash » Mon 08 Dec 2008 10:16

To jfudicar:

You need this test project and AQTime only if you can reproduce the memory leak. You can see if the memory leak occurs using Task Manager.

Post Reply