Memoization cache lifetime (source code)

= Memoization cache lifetime

A <memoization cache lifetime> is the interval over which retained entries are available and valid. One table per top-level request shares recursive subproblems within that request; keeping a table between requests also allows the warm $F_5$ and incremental $F_6$ examples. Clearing it loses those savings. Evicting a correct answer can preserve correctness for a terminating <pure function>, while forcing recomputation; changing an input without invalidating an obsolete answer can break correctness.

Specify who owns the table, when context changes invalidate it, and how long keys and results occupy <computer memory>. In a concrete implementation, retained references can keep arguments and answers alive until removal or clearing.<Python 3.14 documentation/functools — Higher-order functions and operations on callable objects (Python 3.14 documentation)>[Python documentation, functools.lru_cache: cache_clear and retention of argument and return-value references until eviction or clearing]{ref} The <memoization> promise is conditional reuse of valid completed answers, not an automatic guarantee of freshness, termination or bounded <computer memory>.

// Target: computer-science.bigb