out-of-memory
Posted: 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;
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;