[Lazarus] Finding memory leaks

Martin Frb lazarus at mfriebe.de
Sun Oct 25 04:51:28 CET 2015


On 24/10/2015 13:51, Aradeonas wrote:
> Is there any way to count objects or whatever so I can find what 
> object will not free?
> I cant gett much of help from report becuase its very big (about 
> 100,000 line) and it have many items like this :
>
>     Call trace for block $0030EEC8 size 88
>       $0049664B  TFONTHANDLECACHE__ADD,  line 104 of ./include/font.inc
>       $00497F37  TFONT__REFERENCENEEDED,  line 1157 of ./include/font.inc
>       $00498275  TFONT__GETREFERENCE,  line 1277 of ./include/font.inc
>       $0041FE77  SCREENGETSYSTEMFONT,  line 51 of ./include/screen.inc
>       $0049A6B1  TCANVAS__TEXTRECT,  line 1290 of ./include/canvas.inc
>       $00520133  TCUSTOMPANEL__PAINT,  line 127 of
>     ./include/custompanel.inc
>       $004FF413  TCUSTOMCONTROL__PAINTWINDOW,  line 126 of
>     ./include/customcontrol.inc
>       $BAADF00D
>
> Or it address end of procedures or ... .
> So how can I find out what is the problem?
>

  look at http://wiki.freepascal.org/leakview
If you redirect above to a file ( set environment HEAPTRC to log=file / 
on windows setting environment requires a newer gdb, see the Lazarus 
sourceforge site), then you can load them.

Search for those that include your code.
The ide shows how often each leak recurred "(n times)",  find the ones 
with low count

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


More information about the Lazarus mailing list