Icon View Incident Report

Serious Serious
Reported By: Arthur Williams
Reported On: 12/8/2013
For: Version 4.37 Build 3
# 3991 Cannot Create Memory Tables Greater than 2GB in Size with 64-Bit Application/Server

I'm attempting to use an in-memory table in a 64 bit Delphi application. When I write the 15 million records to a disk table, it works fine, and the table ends up being approximately 1.7 GB in size.

When I try to do the same thing to an in-memory table, I eventually get an odd error:

EurekaLog 7.0.6.0

Exception:
------------------------------------------------
2.2 Address: 000000000052FE68
2.5 Type : EListError
2.6 Message: List index out of bounds (32767).
2.7 ID : 8A710000
2.11 Sent : 0

I am testing DBISAM to see if it can exploit the memory available in a 64bit application. In 32 bit mode, the program fails when it reaches ~ 1.7GB of memory. In 64bit mode, it gets up to around 2.2 - 2.7 before it fails on this TList error. The code is as follows.

procedure TForm3.Button2Click(Sender: TObject);
begin

  simain.ClearLog;

  DBISAMSession1.Active := True;

  if memsectors.Exists then
  begin
   memsectors.DeleteTable;
   SiMain.LogVerbose('Deleting local sectors table');
  end;

  with memsectors do
  begin
    if not Exists then
    begin
      SiMain.LogVerbose('Initializing SECTORS Table');
      FieldDefs.Clear;
      with FieldDefs do
      begin
        Add('idxno',ftAutoInc,0,True);
        Add('name',ftString,40,True);
        Add('playerid',ftInteger,0,True);
        Add('locx',ftWord,0,True);
        Add('locy',ftWord,0,True);
        Add('specflags',ftWord,0,True);
        Add('spectype',ftWord,0,True);
        Add('startype',ftWord,0,True);
        Add('aniscale',ftWord,0,True);
        Add('anispeed',ftWord,0,True);
        Add('objects',ftBlob,0,False);
        Add('objcount',ftInteger,0,True);
        Add('obscount',ftInteger,0,True);
      end;
            with IndexDefs do
            begin
                 Clear;
         Add('','idxno',[ixPrimary,ixUnique]);
         Add('pkey','playerid',[ixCaseInsensitive]);
            end;
      CreateTable;
    end;
    Open;
  end;

  GenUniverse(memsectors);

  memsectors.Close;
  DBISAMSession1.Active := False;
end;

procedure TForm3.GenUniverse(atable: TDBISAMTable);
var
  i    : integer;
  zstr  : string;
begin
  SiMain.LogVerbose('Saving Universe');


  SetLength(zstr,32769);

  for i := 1 to 1000000*15 do
  begin

    if (i mod 100000) = 0 then SiMain.LogVerbose('Wrote record 
#'+IntToStr(i));


    atable.Append;

    atable.FieldByName('idxno').AsInteger := i;
    atable.FieldByName('name').AsString := 'Starr'+IntToStr(i);
    atable.FieldByName('playerid').AsInteger := i;
    atable.FieldByName('locx').AsInteger := 12;
    atable.FieldByName('locy').AsInteger := 11;
    atable.FieldByName('specflags').AsInteger := 27;
    atable.FieldByName('spectype').AsInteger := 35;
    atable.FieldByName('startype').AsInteger := 22;
    atable.FieldByName('aniscale').AsInteger := 80;
    atable.FieldByName('anispeed').AsInteger := 81;
    atable.FieldByName('objects').AsString := zstr;
    atable.FieldByName('objcount').AsInteger := 0;
    atable.FieldByName('obscount').AsInteger := 0;

    atable.Post;
  end;
  SiMain.LogVerbose('Save complete');

end;



Resolution Resolution
Fixed Problem on 12/20/2013 in version 4.38 build 1


Products Affected Products Affected
DBISAM Additional Software and Utilities
DBISAM ODBC Client-Server
DBISAM ODBC Client-Server with Source
DBISAM ODBC Standard
DBISAM ODBC Standard with Source
DBISAM ODBC Trial
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source
DBISAM VCL Trial

Image