Swap
← Research library

Foundations · November 7, 2026

Why a bounded input queue can retain extra memory

A finite queue study compared logical contact limits with the actual storage retained by arrays, copies and work already taken out of the queue.

Counting samples and counting bytes

The historical coordinator admitted four segments and at most 2,048 observed samples. Predicted samples bypassed storage. Four segments could share one geometry or hold four different ones. A data structure can reserve more element slots than it currently contains. A copy can also keep older storage alive after the queue has moved on.

One standalone Mac build ran 18 frozen probe cases. A later audit applied 44 checks to the resulting records. These were 18 probes, with an audit of their evidence. The measured segment values alone occupied 448 bytes for four slots, excluding their backing allocations.

Observed process differences

Examples below are raw changes in the running process’s live allocated bytes at checkpoints within the probe. Collection and instrumentation also allocate memory. Values cannot be summed as though they were isolated object sizes.

CaseOutcome
Four segments sharing geometry, 2,048 samples220,048-byte live difference
Four distinct geometries, 2,048 samples287,632-byte live difference
One deliberately over-reserved geometry, two samples934,608-byte live difference
Retaining an old copy while changing the new oneOld copy still held 2,047 samples
An item taken from the queue before a barrier2,048 samples remained in the in-flight item

What a producer would actually allocate

The deliberately over-reserved geometry satisfied the public count and text-length conditions. Source inspection of the keyboard’s own producer found a 26-key layout with short identifiers and no such explicit reservation. The observation identified a limit of counting rules. It did not show that this unusually large allocation occurred in the product.

Overflow left a cancelled, unfinished prefix and paused new admission. Draining retained the expected command order. Quantifying an actual extension’s upper memory requirement would additionally require the runtime, editor, host-facing state and work in flight, on a specified build.

Sources

  • Finite queue representation accounting
  • Keyboard extension memory envelope

← Browse all research