Watching heap memory usage in Free Pascal/Delphi
Free Pascal (like Delphi) provide some useful functions to watch heap memory state in your application.
function GetHeapStatus: THeapStatus;
THeapStatus is documented here
Example of using this function is below
program ProgWatchMem;
uses
Math, FGL;
type
TLongIntArr = array of LongInt; // LongInt is a 4-byte signed integer
PLongIntArr = ^TLongIntArr;
TMySortedMap = specialize …