Skip to main content

split_memory_budget

Function split_memory_budget 

Source
pub fn split_memory_budget(total: u64) -> MemoryBudget
Expand description

Split a total byte budget across the block cache, the dictionary chunk cache and the index tile cache (bounded-export phase 2, plan §5.2). u64::MAX (unlimited, e.g. --in-memory or --memory-budget-mb 0) passes straight through to every consumer.

The dictionary is the dominant consumer on scholar files (literal-heavy object section), and its chunks recur across windows, so it gets the bulk of the budget; the tile cache is small (a scanned permutation is far smaller than the dictionary) and the block cache stays modest, capped like every other ranged reader at crate::block_cache::DEFAULT_CACHE_CAP.