heaptrc: Difference between revisions
From Free Pascal wiki
Jump to navigationJump to search
Jwdietrich (talk | contribs) |
(Dialog boxes stuff is more a bug than a feature. Added console mode info) |
||
Line 1: | Line 1: | ||
'''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. | '''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. | ||
When a program using heaptrc ends, heaptrc can write out the total memory used and a list of allocated but not freed blocks to a file. | |||
When run in the console (*nix or Windows), heaptrc will print this output to screen unless otherwise instructed. | |||
In Lazarus GUI programs on Windows, the output will appear in numerous small dialog boxes, which is very unpractical. On *nix, by default, nothing will be shown for GUI programs. See [[leakview]] for details on how to make use of heaptrc effectively. | |||
== See also == | == See also == |
Revision as of 10:18, 22 April 2014
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.
When a program using heaptrc ends, heaptrc can write out the total memory used and a list of allocated but not freed blocks to a file. When run in the console (*nix or Windows), heaptrc will print this output to screen unless otherwise instructed. In Lazarus GUI programs on Windows, the output will appear in numerous small dialog boxes, which is very unpractical. On *nix, by default, nothing will be shown for GUI programs. See leakview for details on how to make use of heaptrc effectively.
See also
- leakview: Examples how to enable heaptrc in Lazarus and Free Pascal.
- RTL Reference for unit 'heaptrc'