property CacheBudgetBytes: Int64; // read and write, default 256 MiB
Every TPdf instance owns a private TPdfCacheGovernor, and this property is its MaxBytes ceiling. Retained parsed page scenes, thumbnails, structure element trees, text page snapshots, page-object snapshots, and any TPdfTileCache attached to the same governor all reserve their measured bytes against this one budget
Bitmap caches are measured as width times height times four bytes, managed snapshot caches are estimated from their records, strings, arrays, and byte buffers, and opaque parsed PDFium page scenes carry an 8 MiB accounting charge per retained scene
Lowering the value applies immediately: least-recently-used unpinned entries are evicted across all participating caches until measured usage fits the new ceiling
Setting the budget to zero disables new retention, every reservation is then rejected and counted in RejectionCount, while already active pinned page scenes are released as soon as rendering completes
Active parsed page scenes are pinned during rendering and may keep measured usage temporarily above a reduced budget until rendering releases them
Negative values raise EPdfError. Reading returns the current ceiling, and returns 0 when the governor is unavailable, which in practice only happens outside the normal component lifetime
The budget covers retained library cache entries only; caller-owned bitmap copies and returned snapshot copies stay outside the budget
Pdf.CacheBudgetBytes := Int64(128) * 1024 * 1024;
Stats := Pdf.CacheGovernorStatistics;
LogCacheBudget(Stats.StoredBytes, Stats.PeakStoredBytes);