mirror of
https://github.com/ollama/ollama.git
synced 2026-07-30 17:38:02 -04:00
Keeping the recurrent conv state small was handled unevenly: the committed live state was recopied on every commit — wasted work on single-token decode, where the window is already tiny — while boundary states captured as snapshots could still be plain slices of the forward-sized convolution buffer. A cached slice pins that whole buffer even though the trie's eviction accounting only counts the slice's bytes, so recurrent cache memory piled up across requests and eviction could never reclaim it. Compact each boundary state to its real size once, where it is produced in the conv wrapper, so live state and snapshots own only their own bytes and eviction sees the true cost. Single-token decode leaves the already-tiny window as a slice. Fixes #16698