[fpc-pascal] Best practice for getting heap usage summary
Jonas Maebe
jonas.maebe at elis.ugent.be
Thu Jan 19 10:54:24 CET 2012
On 19 Jan 2012, at 10:38, Mark Morgan Lloyd wrote:
> Mattias Gaertner wrote:
>
>> Maybe you mean GetFPCHeapStatus
>> http://lazarus-ccr.sourceforge.net/docs/rtl/system/getfpcheapstatus.html
>> There is also the Delphi compatible GetHeapStatus, but only for
>> 32bit.
>
> Yes, I was assuming that was necessary to get the THeapStatus block.
> I take it that you're confirming that this is the way to get the
> info, and that there aren't direct RTL calls.
The above is a direct RTL call. But note that
a) it is buggy in case of multi-threaded programs: http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=14315
b) it won't contain any information at all if you use cmem or another
memory manager that does not keep track of allocation information.
Jonas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20120119/f4a46a37/attachment.html>
More information about the fpc-pascal
mailing list