[Lazarus] Lazarus win32 with fpc-3.0.4 no memory left problem

Andreas Frieß friess at gmx.at
Fri May 25 21:19:49 CEST 2018


Mattias Gaertner via Lazarus wrote:

> On Mon, 21 May 2018 21:44:59 +0200
> Andreas Frieß via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
> 
> > If someone can backport this please. The fix from Bugreport 0031517
> > to the actual stable or must this a extra feature report ?
> 
> See
> https://bugs.freepascal.org/view.php?id=31517
> 
> Is the bug present in fpc 3.0.4?
> 
IMHO yes. 

I think its not direct a bug, but the linking of Lazarus need sometimes
(with more packages) more memory in fpc.
The same problem occours if you ask for more memory on windows.

See also
http://forum.lazarus.freepascal.org/index.php/topic,40351.0.html

> Mattias

Andreas


 A shot test for win 32 from the thread above
------------------
procedure TForm1.BuTestitClick(Sender: TObject);
const
  coTestsize = 10*1024*1024;
  coKB = 1024;
  coMB = coKB * 1024;
var
  list : TList;
  i,j,aktIDX : Integer;
begin
  list := TList.Create;
  //
  for i := 1 to 10000 do begin
    if i mod 5 = 0 then Memo1.Append('Used size: ' +
IntToStr((i*coTestsize) div (coMB))+ ' MB');
    aktIDX := list.Add(getmem(coTestsize)); // List of PChar
    if list.Items[aktIDX] = pointer(0) then begin
      Memo1.Append('No memory at : ' + IntToStr(i));
      exit;
    end;
    for j := 0 to coTestsize-1 do begin
      PChar(list.Items[aktIDX])[j] := #$FA;
    end;
  end;
  list.Free;
end;
 



More information about the Lazarus mailing list