Possible memory leak? lazarus / 8-Other ---------------------------------------------------------------------- eden159 · 2007-02-14 09:33 I think I found a memory leak. Here is what I do: I have a TList object and add objects in it then I iterate through all the objects, free them and call the Clear method of the TList object: Code: [Select]   for i := 0 to AList.Count - 1 do   begin     TTickData(AList[i]).Free;   end;   AList.Clear; Here is a link to a simple program I created - just create more than 100 000 objects, delete them, create them again and delete them again. The more you do it, the more memory remains taken. P.S. I'm using Lazarus 0.9.20 on Windows XP. ---------------------------------------------------------------------- Zomis · 2007-02-14 11:16 Honestly, I think Delphi works the same way. I experimented with that many years ago, and I discovered the same thing with Delphi. So I wonder if it's really a bug.. ---------------------------------------------------------------------- eden159 · 2007-02-14 12:38 Are there any tools that can be used to detect memory leaks in Lazarus? I know this one for Delphi, but I haven't tested it for Lazarus yet. ---------------------------------------------------------------------- Vincent Snijders · 2007-02-14 15:54 Enable the use of heaptrc unit in the linker tab of the compiler option. See the fpc documentation for more information about heaptrc and its use. ---------------------------------------------------------------------- eden159 · 2007-02-15 21:57 Quote from: "Vincent"Enable the use of heaptrc unit in the linker tab of the compiler option. See the fpc documentation for more information about heaptrc and its use. Thanks - that helped me find the problem.