[fixed in 9.7.24] ORA-01578 / ORA-01110 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
pcz
Posts: 81
Joined: Tue 04 Aug 2015 12:53

[fixed in 9.7.24] ORA-01578 / ORA-01110 causes memory leak

Post by pcz » Thu 21 Apr 2016 11:50

Hello

When TOraQuery meets

ORA-01578: ORACLE data block corrupted
+
ORA-01113

Image

there is always memory leak when closing application (ReportMemoryLeaksOnShutdown turned on)

Image

Happens both in Blocking / NonBlocking mode

Tested with:
Delphi: XE7 Professional 21.0.17707.5020
App architecture: 32-bit Windows
OCI: Release 9.2.0.1.0 - Production
ODAC: 9.6.22 Professional

Size of leak remains the same after calling <TOraUery>.Open several times


Regards
P.C.
Last edited by pcz on Tue 28 Jun 2016 08:02, edited 1 time in total.

pcz
Posts: 81
Joined: Tue 04 Aug 2015 12:53

Re: ORA-01578 / ORA-01110 causes memory leak

Post by pcz » Fri 22 Apr 2016 13:03

Exactly the same leak happens in direct mode

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: ORA-01578 / ORA-01110 causes memory leak

Post by MaximG » Tue 26 Apr 2016 11:05

We have investigated behavior of ODAC 9.6.22 and the latest version 9.7.23 on attempt to call damaged Oracle data blocks. Unfortunately, we couldn't detect a memory leak in this case. In our test, the Emp table was damaged, and the following console application hasn't found any issues :

Code: Select all

program OraBlockCorrupted;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils, DB, Ora;

var
  OraSession: TOraSession;
  Query: TOraQuery;

begin
  ReportMemoryLeaksOnShutdown := True;
  OraSession := TOraSession.Create(nil);
  try
    OraSession.ConnectString := '<your username>/<your password>@<SID>';
    OraSession.Connect;
    Query := TOraQuery.Create(Nil);
    try
      Query.Session := OraSession;
      Query.SQL.Clear;
      Query.SQL.Add('Select * From Emp');
      Query.Open;
    finally
      Query.Free
    end;
  finally
    OraSession.Free;
  end;
end.
Please try to reproduce the issue using this application and let us know the result.

pcz
Posts: 81
Joined: Tue 04 Aug 2015 12:53

Re: ORA-01578 / ORA-01110 causes memory leak

Post by pcz » Tue 26 Apr 2016 11:54

I have to add line

Code: Select all

Query.FetchAll := True;
before

Code: Select all

Query.Open;
because my bad block happens in some farther records

I have built code with 9.6.22 Pro and then downloaded 9.7.23 Pro, installed and recompiled again
Result is the same:

Image

I fetch a plenty of data so application memory usage is ~1,5 GB when problem happens (yup, I know about 32-bit memory limitations but I didn't reach it)

:?

pcz
Posts: 81
Joined: Tue 04 Aug 2015 12:53

Re: ORA-01578 / ORA-01110 causes memory leak

Post by pcz » Thu 28 Apr 2016 12:17

There is a positive trend ;)

Same code compiled with ODAC 9.7.24 Pro

Direct & OCI give equal result:
Image

pcz
Posts: 81
Joined: Tue 04 Aug 2015 12:53

Re: ORA-01578 / ORA-01110 causes memory leak

Post by pcz » Thu 28 Apr 2016 12:46

Oooh.... my stupidity :P
It's because lack of global try..except block in console apps :P

So.... I wrapped it around existing code and it looks that problem is fixed - no more leaks both in direct and OCI mode 8)

Thanks! :)

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: ORA-01578 / ORA-01110 causes memory leak

Post by MaximG » Thu 28 Apr 2016 13:35

Thank you for the information. We are glad you have localized the problem. The new ODAC build 9.7.24 (28-Apr-2016) is released. You can download ODAC 9.7.24 from https://secure.devart.com .
Please don't hesitate to contact us with questions concerning ODAC usage.

Post Reply