Skip to main content

Module gc

Module gc 

Source
Expand description

Cost-aware garbage collection for FsActionStore.

Evicts blobs only — action records are always retained, so an evicted entry is regenerable: the next run recomputes it and re-fills the same content address (Nectar: eviction degrades performance, never correctness).

Eviction order is by value density, ascending:

score(blob) = max over records naming it of
              (compute_ms + 1) × recency_weight ÷ size_bytes

so a 100-byte state that took two days to fit outlives a 10 GB intermediate that took two minutes, and never the other way around (plain LRU gets this exactly wrong for research pipelines). Blobs referenced by pinned actions are GC roots and never evicted.

Structs§

GcPolicy
When to evict and how much to keep. Defaults: 20 GiB ceiling, one-hour minimum age.
GcReport
What one collect pass did, for soma cache gc output.

Functions§

collect
Run one collection pass. Safe to run while writers are active: blob puts are idempotent, and an evict-then-immediate-reput just re-creates the file.