Bounded Object-Stream Cache

Loaded cross-reference streams can index compressed members without retaining every decoded /Type /ObjStm container in memory

Byte limit and eviction

ObjectStreamCacheMaxBytes sets the decoded-container budget and defaults to 64 MiB

When an insertion crosses the budget, inactive containers are evicted individually in least-recently-used order while the container currently serving a parser view remains protected until that view closes

A single container larger than the limit can therefore be resident during its active parse, but retained bytes converge to the configured limit immediately afterwards

Reloadable members

Eviction preserves object-number indexes and validated member offsets

A later member resolution reopens the original container stream, reapplies document decryption and stream filters, and parses the requested member through the existing zero-copy slice view

Set the limit to zero to retain no decoded containers between member resolutions

Telemetry

GetLoadedObjectStreamCacheInfo reports the configured limit, current and peak decoded bytes, eviction and reload counts, member cache hits and misses, and zero-copy slice activity

See also: ObjectStreamCacheMaxBytes, GetLoadedObjectStreamCacheInfo, Zero-Copy Object-Stream Slices