OptionalheapLimitBytes: number
Override for the device heap limit (tests). When omitted, readHeapLimitBytes is consulted; an explicitly passed non-positive value skips the heap path WITHOUT probing browser state.
OptionalpoolOverrideBytes: number
Explicit total cache pool in bytes. Takes precedence over the heap-derived remainder.
OptionalfallbackPoolBytes: number
Device-class total cache pool in bytes, used only when neither an explicit pool nor a measurable heap is available.
Heap headroom left OUTSIDE the cache pool — the shared memory model every non-cache consumer sizes itself from (the eager child loader, refinement residency, GPU geometry, the L2 write queue), so a session uses ONE remainder rather than each consumer inventing its own view of the heap.
Resolution matches the cache pool: explicit pool override → measured heap → device-class pool. A pool-based input is converted back to the remainder it implies (
pool × NON_CACHE/CACHE) so a WebKit session — where the heap cannot be measured at all — stays on the same model as a Chrome one.Returns
undefinedwhen there is no memory signal at all (non-browser / Firefox+Safari without an override), so each consumer applies its own no-signal fallback.