pub struct StoreMemory {Show 13 fields
pub fixed_bytes: usize,
pub slab_bytes: usize,
pub boxed_payload_bytes: usize,
pub current_table_bytes: usize,
pub retired_table_bytes: usize,
pub retired_tables: usize,
pub retirement_tracking_bytes: usize,
pub rehash_scratch_bytes: usize,
pub largest_rehash_scratch_bytes: usize,
pub strings: StringsMemory,
pub has_printer: bool,
pub has_draws: bool,
pub has_registers: bool,
}Expand description
A snapshot of known persistent-store storage and explicit accounting gaps.
Allocated slab slots and buffer capacities are measured, including unused slots. Nonempty retired hash tables are counted once while any cached reader retains them. This is a component snapshot, not an atomic process snapshot, a peak-memory measurement or an allocation-time limit.
Known retained bytes exclude allocator rounding/metadata, Arc control blocks, opaque string-index bucket overhead/spare capacity, and externally owned printer names, random streams and registers. Worker arenas, caches and graph buffers belong to their respective owners, not this snapshot. Whole-process RSS accounting remains necessary and is itself sampled, not a hard allocation-time cap.
Fields§
§fixed_bytes: usizeStore object and allocated column/shard/generation/counter arrays.
slab_bytes: usizeActual allocated OnceLock slab slots, including unused slots.
boxed_payload_bytes: usizeHandle slices boxed by large or representation-preserving nodes.
current_table_bytes: usizePayload bytes in the current deduplication tables.
retired_table_bytes: usizePayload bytes in nonempty old tables still owned by cached readers.
retired_tables: usizeNumber of nonempty old tables still owned by cached readers.
retirement_tracking_bytes: usizeAllocated retirement-record vector capacity, including unused slots.
rehash_scratch_bytes: usizeCumulative temporary Vec<u64> bytes requested by index rehashes.
These are allocation traffic, not currently retained bytes.
largest_rehash_scratch_bytes: usizeLargest individual rehash temporary vector capacity in bytes. This is not a concurrent or whole-store peak; old/new tables overlap it.
strings: StringsMemoryString-table payload, slot storage and opaque index capacity.
has_printer: boolThe store retains a shared external printer/name context.
has_draws: boolThe store retains a shared external random-stream provider.
has_registers: boolThe store retains a shared external register provider.
Implementations§
Source§impl StoreMemory
impl StoreMemory
Sourcepub fn known_retained_bytes(self) -> Option<usize>
pub fn known_retained_bytes(self) -> Option<usize>
A lower bound on retained bytes of the measured components, or None
on arithmetic overflow. Rehash traffic is excluded; gaps are documented
on StoreMemory. This must not be used as a complete memory budget.