[solved] heaptrc mem leak tutorial lazarus / 12-Debugger ---------------------------------------------------------------------- anonymousstranger · 2018-08-30 18:10 Is there an updated and current tutorial on how to use heaptrc to find memory leaks (including setup)? All the tutorials I've been able to find use previous versions of lazarus, which renders them mostly unhelpful. If not, could someone help me with this? I'm using v1.8.4 with fpc 3.0.4 i386 win32/win64. ---------------------------------------------------------------------- ASerge · 2018-08-30 18:25 Quote from: anonymousstranger on August 30, 2018, 08:10:48 pm...how to use heaptrc to find memory leaks (including setup)? Project Options/Compiler Options/Debugger/Use Heaptrc unit (check for mem-leaks) (-gh) ---------------------------------------------------------------------- Martin_fr · 2018-08-30 18:47 https://www.freepascal.org/docs- html/3.0.0/rtl/heaptrc/environment.html You also may want to set a logfile (Menu Run > Run Param). You can then load the logfile *.trc in the "Leak and Traces" which you find in the view menu. If you get memory corruption (rather than leaks), then also use keepreleased. Otherwise this is not needed. On Linux, there is an alternative named valgrind. It is outside the IDE, and goes way beyond just leaks. But it needs some reading up. ---------------------------------------------------------------------- anonymousstranger · 2018-08-30 19:03 Thanks Just found this too: http://wiki.lazarus.freepascal.org/leakview ---------------------------------------------------------------------- avra · 2018-08-30 21:23 http://wiki.lazarus.freepascal.org/heaptrc