I was debugging memory leak. I want to locate the actual code line that causes a memory leak. I searched on the internet for open-source tools and found FastMM
I set up it for with FullDebugMode and LogMemoryLeakDetailToFile.
I got the following log text file:
A memory block has been leaked. The size is: 56
This block was allocated by thread 0x3840, and the stack trace (return addresses) at the time was:
424559 [FastMM4.pas][FastMM4][_ZN7Fastmm411DebugGetMemEx][9659]
4248F6 [FastMM4.pas][FastMM4][_ZN7Fastmm415DebugReallocMemEPvx][9878]
40938D [System.pas][System][_ZN6System11_ReallocMemERPvx][4819]
412C9C [System.pas][System][_ZN6System17DynArraySetLengthERPvS0_xPx][35000]
4623F1 [System.Generics.Collections.pas][System.Generics.Collections][_ZN6System8Generics11Collections11TListHelperE@InternalSetCapacity][3845]
460BD6 [System.Generics.Collections.pas][System.Generics.Collections][_ZN6System8Generics11Collections11TListHelperE@InternalGrow][3106]
460C0D [System.Generics.Collections.pas][System.Generics.Collections][_ZN6System8Generics11Collections11TListHelperE@InternalGrowCheck][3112]
45F243 [System.Generics.Collections.pas][System.Generics.Collections][_ZN6System8Generics11Collections11TListHelperE@InternalAdd8][2487]
6EF13D [System.JSON.pas][System.JSON][_ZN6System4Json11TJSONObjectE@AddDescendant][1831]
6EF64E [System.JSON.pas][System.JSON][_ZN6System4Json11TJSONObjectE@ParsePair][1979]
6EF4BB [System.JSON.pas][System.JSON][_ZN6System4Json11TJSONObjectE@Parse][1924]
The block is currently used for an object of class: Unknown
So it only notifies if any memory leaks occur. I don't understand how to use this file and find the actual code line that causes memory. is there any way to find that easily?



I have had some success using MadExcept tools to do this, although it has also stopped me from being able to run some projects when I turn leak detection on.