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

Is there a way to programmatically tell if particular block of memory was not freed by FastMM?

Even if such handler exist, it would be nearly useless, as everything, including DB would be shut down at the time when FastMM reports leaks. So, I suggest you to turn on LogErrorsToFile along with FullDebugMode conditionals in FastMM4Options.inc. This will give you a text file with leaks, which later you can parse and put … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)