MemoryPolicy class

Tuning for the orchestrator's memory behavior.

Constructors

MemoryPolicy({double headroomFraction = 0.15, int minContextTokens = 2048, int maxContextTokens = 32768, double resizeHysteresisFraction = 0.10, Duration resizeCooldown = const Duration(seconds: 30), Duration pollInterval = const Duration(seconds: 5), double pressureAvailableFraction = 0.08, bool unloadOnCritical = false, int maxStashBytes = 1024 * 1024 * 1024})
Creates a policy.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
headroomFraction → double
Fraction of available memory deliberately left unused.
final
maxContextTokens → int
Hard ceiling on planned context size, regardless of memory.
final
maxStashBytes → int
Byte cap on the engine-side in-memory KV stash. When agent swaps push past it, the oldest stashes are dropped (those agents re-prefill on their next turn). The most recent stash is always kept, even alone over the cap.
final
minContextTokens → int
Below this context size the orchestrator refuses to shrink further and reports memory-critical instead.
final
pollInterval → Duration
How often the orchestrator samples system memory.
final
pressureAvailableFraction → double
Available memory below this fraction of total counts as pressure: shrinks apply immediately, growth is suppressed.
final
resizeCooldown → Duration
Minimum quiet period between resizes. Bypassed under pressure.
final
resizeHysteresisFraction → double
Target/current differences within this fraction are ignored — resizing recreates the context, so thrash costs more than being slightly off-budget.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
unloadOnCritical → bool
Whether a memory-critical verdict unloads the model (instead of only emitting an event and hoping the app reacts).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited