heaptrc
From Lazarus wiki
heaptrc is a unit that can be used to debug allocation and deallocation of memory blocks. It keeps track of calls to getmem/freemem, and, implicitly, of New/Dispose statements.
On Lazarus for Windows it displays the total memory used and then dumps a list of blocks that were allocated but not freed, in a dialog box after termination of the program. Additionally it can store its output to file, which is the only mode of operation on Unix systems.
See also
- leakview: Examples how to enable heaptrc in Lazarus and Free Pascal.
- RTL Reference for unit 'heaptrc'