How to get a stack trace from FastMM

The internal Delphi version of FastMM doesn’t support stack traces. If you want to log the memory leak stack traces, you have to: download the full version of the FastMM library include it as the first unit in your project: program YourProject; uses FastMM4, // <– SysUtils, Forms, … enable the FullDebugMode option in FastMM4Options.inc … Read more

How to get the Memory Used by a Delphi Program

You can get useful memory usage information out of the Delphi runtime without using any direct Win32 calls: unit X; uses FastMM4; //include this or method will return 0. …. function GetMemoryUsed: UInt64; var st: TMemoryManagerState; sb: TSmallBlockTypeState; begin GetMemoryManagerState(st); result := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize; for sb in st.SmallBlockTypeStates do begin result := result + … Read more