This bug demo program compiled with fpc 2.0.1 stable under linux uses megabytes of memory.
Concatenating a string and a variant causes the problem.
Thank you,
Franz Schober
program heapstate;
uses Classes,sysutils;
procedure DumpHeapState;
var HS:THeapStatus;
o:string;
begin
HS:=GetHeapStatus;
o:=Format('HEAP STATE TA/TF %d/%d TC/TU %d/%d UU %d OH
%d',[hs.TotalAllocated,hs.TotalFree,hs.TotalCommitted,hs.TotalUncommitted,hs
.Unused,hs.Overhead]);
writeln(o);
end;
var i:integer;
s,s2:string;
v:variant;
begin
for i:=1 to 2000000000 do begin
v:='10';
s:=' leak '+v;
if i mod 100000=0 then begin
DumpHeapState;
end;
end;
readln;
end.