# Steady state recycles resources

Principle `steady-state-recycles-resources`. Every accumulation needs a deliberate recycling policy.

Also searched as: steady state, retention policy.

Growing logs, retained rows, caches, and objects need a counter-mechanism. Normal operation should not depend on repeated manual cleanup.

> The Steady State pattern says, for every mechanism that accumulates a resource, some other mechanism must recycle that resource.

Source: [Q08](/bibliography#q08); [B4](/bibliography#b4-release-it).

## Failure it prevents

Memory, storage, or latency fails after enough otherwise-successful operations.

## Our Effect 4.0.5 reading

Cache and Scope cover runtime lifetime. PersistedQueue.layerCleanup handles retained queue records. Durable domain data still needs a storage policy and maintenance owner.

Source: `packages/effect/src/Cache.ts`, `packages/effect/src/Scope.ts`, `packages/effect/src/persistence/PersistedQueue.ts`.

## How to check

Inspect growth over repeated work. Check retention against replay and dedupe requirements before deleting recovery evidence. This is our proposed verification, not a quoted procedure.

Continue with [Queries need result bounds](/principles/queries-need-result-bounds), [Dead letters need a return path](/principles/dead-letters-need-a-return-path).

Connect this to [the existing rat-stack guidance](https://ratstack.sh/lore/scopes-own-resources).

Use [the durability skill](/skills/durability) for the full review. Return to [the durability index](/principles/durability).

## Skills
- [Durability starts with a recovery record](/principles/durability)

## Sources
- Nygard, Michael T. *Release It!: Design and Deploy Production-Ready Software*. Pragmatic Bookshelf, 2007. [Link](https://archive.org/details/releaseitdesignd0000nyga). ([b4-release-it](/bibliography#b4-release-it))

## References
- [Effect contributors. Effect 4.0.5. Cache.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Cache.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. Scope.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/Scope.ts). Pinned source for our Effect mapping, not a claim from the book.
- [Effect contributors. Effect 4.0.5. persistence/PersistedQueue.ts](https://github.com/Effect-TS/effect/blob/7f524e25cfb49a71ac39b0f44278d08d40dda5de/packages/effect/src/persistence/PersistedQueue.ts). Pinned source for our Effect mapping, not a claim from the book.
