[Lazarus] Finding memory leaks

Aradeonas aradeonas at operamail.com
Sat Oct 24 15:10:50 CEST 2015


My question stand but I guess problem is in TObjectList but Im not sure so I made a simple demo like this:

> procedure TForm1.Button1Click(Sender: TObject); var  i: integer;  b:
> TButton; begin  list := TObjectList.Create(True);  for i := 0 to 10000
> do  begin    b := TButton.Create(Self);    list.Add(b);  end; end;
>
> procedure TForm1.Button2Click(Sender: TObject); begin  list.Clear;
> list.Free;          end;

Form is clean and just have 2 button with their code so I run it and
memory usage in my Windows10 device is about 3mb and then hit the
button1 and memory goes up to 25mb and when I want to free and hit
button2 memory will decrease to 15mb not 3 , just like my main
program that I use TObjectList and will free its objects with remove
function but it will increase memory usage while running. Did I miss
something obvious?

Regards, Ara


-- 
http://www.fastmail.com - IMAP accessible web-mail

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20151024/452e3043/attachment-0003.html>


More information about the Lazarus mailing list