out-of-memory

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
uffek
Posts: 37
Joined: Fri 14 Nov 2014 21:49
Location: Roskilde, DK

out-of-memory

Post by uffek » Thu 15 Nov 2018 12:59

I am reading through a whole table with 6 mio records, but ends up running out of memory (with 16 GB), way before I have reached the end. The code below is a cut down version, to illustrate it. Using MSSQL and postgresql works OK, on the same code and data.

The table contains a SDO_GEOMETRY field and that is obviously what is causing the leak, but since I need to read and process it, I can not skip it. This used to work in earlier versions of ODAC / Unidac, but I can not say exactly which one.

You can ignore the support request sent through your form on the website. As long as you fix the bug !

var
Con: TUniConnection;
Qry: TUniQuery;
attribute: word;
f: TField;
begin
Con:= TUniConnection.Create(nil);
Con.ProviderName := 'Oracle';
Con.SpecificOptions.Add('Direct=True');
Con.Server := 'DELL-2:1521:XE';
Con.Username := 'GIS1';
Con.Password := 'xxxxx';
Con.Database := '';
Con.LoginPrompt := False;
Con.Open;

Qry:= TUniQuery.Create(nil);
Qry.Connection := con;
Qry.SQL.Add('select * from mytable');
Qry.open;
f:= Qry.FindField('attribute');
while not Qry.eof do
begin
attribute := trunc(f.value);
Qry.Next;
end;
Qry.Close;
Con.Close;
end;

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

Re: out-of-memory

Post by MaximG » Fri 16 Nov 2018 10:02

We tested the operation of UniDAC 7.3.10 according to your description and did not find any memory leaks. For further investigation, please compose and send us a small full test sample demonstrating memory leaks occurrence. In addition, we will need a DDL script to create the table used in this sample, as well as a sample filling it with test data. It is convenient to do via the e-support form (https://www.devart.com/company/contactform.html).

uffek
Posts: 37
Joined: Fri 14 Nov 2014 21:49
Location: Roskilde, DK

Re: out-of-memory

Post by uffek » Fri 16 Nov 2018 10:40

Maybe you can tell me about the content of the table you have tested with?
Which fields and what type of SDO_GEOMETRY? Points, lines, polygons?
How many records?

We can also do a skype session with screen sharing, so you can see for yourself. Obviously the issue is the data, since the test application is as simple as it can be. Even this simple test gives an out-of-memory after about 1 mio records:

Qry.SQL.Add('select geoloc from mytable');
Qry.open;
while not Qry.eof do
begin
Qry.Next;
end;

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

Re: out-of-memory

Post by MaximG » Mon 19 Nov 2018 08:27

To investigate the issue, we will need a DDL script to create the table used in your sample. Please also provide a sample of filling this table with data (for this, it is enough to fill no more than 10 rows of this table). Specify whether the issue with memory leaks in your environment when requesting a table containing a small number of rows. Perhaps when processing a large number of records the UniDirectional mode will help you: https://www.devart.com/unidac/docs/deva ... tional.htm

To provide any additional information on the issue, it is convenient using the e-support form https://www.devart.com/company/contactform.html.

uffek
Posts: 37
Joined: Fri 14 Nov 2014 21:49
Location: Roskilde, DK

Re: out-of-memory

Post by uffek » Mon 19 Nov 2018 08:41

1) How to DDL create from an existing table? I have no experience doing so

2) How to add data, using SDO_GEOMETRY? I have only been reading data so far.
If you can show that using line objects, I can add the actual data,

All my data has been uploaded using MapInfo Easyloader:
http://www.pbinsight.com/support/produc ... easyloader
This both creates the table and fills it with content.

uffek
Posts: 37
Joined: Fri 14 Nov 2014 21:49
Location: Roskilde, DK

Re: out-of-memory

Post by uffek » Mon 19 Nov 2018 08:52

Setting unidirectional to false, seems to fix the issue. Testing some more now.

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

Re: out-of-memory

Post by MaximG » Mon 19 Nov 2018 10:27

We will be waiting for the results of testing in your environment.

uffek
Posts: 37
Joined: Fri 14 Nov 2014 21:49
Location: Roskilde, DK

Re: out-of-memory

Post by uffek » Mon 19 Nov 2018 15:34

Yes, that fixed it.

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

Re: out-of-memory

Post by MaximG » Tue 20 Nov 2018 08:06

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning our product usage.

Post Reply