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 one arena block as configured at creation (65536 by default) |
RetainedBlockCount | Number of blocks the arena currently holds for reuse |
RetainedBytes | Sum of the capacities of all retained blocks |
PeakUsedBytes | Highest number of arena bytes in use during the session |
AllocationCount | Number of allocation requests served from the arena |
BytesRequested | Total bytes requested across all allocations |
BlockAllocationCount | Number of fresh blocks taken from the memory manager |
ReusedAllocationCount | Allocations satisfied from freed space inside existing blocks |
ResetCount | Number of times the arena mark was rolled back or the arena was reset |
TokenCount | Parser tokens counted by the owning load session, filled in by THotPDF after the arena reports |
TemporaryObjectElisionCount | Temporary parser objects elided during the session, also filled in by THotPDF |
Usage notes
- Retrieve a snapshot with
GetLastParserArenaStatistics, which returns false when no arena session is active and zeroes the record - Compare
PeakUsedByteswithRetainedBytesto judge how much memory the arena keeps reserved between sessions TokenCountandTemporaryObjectElisionCountcome from the session counters and are zeroed byBeginParserArenaSession