out of memory

Questions and answers on how to use XLSReadWriteII 5.
Post Reply
taoxl
Posts: 1
Joined: Fri Aug 29, 2014 1:40 am

out of memory

Post by taoxl »

Hi
when i add huge rows to the excel, xls raise an exception: "out of memory"
here is my test code below:

Code: Select all

procedure TfrmMain.btnAdd1Click(Sender: TObject);
var
  i : Integer;
begin
   XLS.Version := xvExcel2007;
   try
     for i:=0 to 900000 do
     begin
        XLS[0].AsInteger[0,i] := i;
     end;
   except
      on e : Exception do
      begin
         ShowMessage(e.Message);
      end;
   end;
end;
when the "out of memory" happened the test application only used 50M memory and my physical memory is almost 8G. i comfirm that i have enough memory to write 1000000 rows. the problem is not my physical memory. please try my test code
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Re: out of memory

Post by larsa »

Hello

If you are using a delphi version that not has FastMM installed (like D7), you must install it.
You can download it here: http://sourceforge.net/projects/fastmm/
Lars Arvidsson, Axolot Data
Post Reply