THPDFParserArenaStatistics Record
Reports block, allocation, token and elision telemetry from the parser arena allocator
Declaration
THPDFParserArenaStatistics= record
BlockSize: Integer;
RetainedBlockCount: Integer;
RetainedBytes: Int64;
PeakUsedBytes: Int64;
AllocationCount: Int64;
BytesRequested: Int64;
BlockAllocationCount: Int64;
ReusedAllocationCount: Int64;
ResetCount: Int64;
TokenCount: Int64;
TemporaryObjectElisionCount: Int64;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
BlockSize | Capacity of a single arena block as configured at creation (65536 by default) |
RetainedBlockCount | Number of blocks the arena currently holds ready for reuse |
RetainedBytes | Sum of the capacities of every retained block |
PeakUsedBytes | Highest number of arena bytes in use at any point in the session |
AllocationCount | Number of allocation requests that the arena served |
BytesRequested | Total bytes requested across every allocation |
BlockAllocationCount | Number of brand-new blocks taken from the memory manager |
ReusedAllocationCount | Allocations satisfied out of freed space inside existing blocks |
ResetCount | Number of times the arena mark was rolled back or the arena reset |
TokenCount | Parser tokens counted by the owning load session, filled in by THotPDF once the arena reports |
TemporaryObjectElisionCount | Temporary parser objects elided during the session, likewise filled in by THotPDF |
Usage notes
- Retrieve a snapshot with
GetLastParserArenaStatistics, which returns false when no arena session is active and sets the record to zero - Compare
PeakUsedByteswithRetainedBytesto gauge how much memory the arena keeps reserved between sessions TokenCountandTemporaryObjectElisionCountcome from the session counters and are set back to zero byBeginParserArenaSession