zendframework/zend-memory
Zend Memory provides PHP memory-management utilities, including a memory manager, memory objects, and storage containers with limit and sliding-window strategies. Useful for controlling memory in long-running processes and cache-like workflows.
Consider it only if all of the following hold:
Look elsewhere when:
queue:work --memory already restarts workers at a threshold and solves most of the operational problem at far lower risk.laminas/laminas-memory—same lineage, actively maintained, PHP 8 compatible. Adopting the archived Zend package when the maintained fork exists has no defensible rationale.Executive summary. This is a legacy, archived Zend Framework component for capping and evicting in-memory objects. It is not a strategic dependency: no active maintenance, no security patching, minimal community footprint, and a maintained successor exists. Recommended position: do not adopt. Use it as reference material for a pattern, not as a dependency.
For engineering. The valuable idea is a memory budget with LRU eviction inside long-running processes. If we have a demonstrated worker-memory problem, solve it in this order: (1) tune queue:work --memory and fix unbounded accumulations in our own code; (2) use laminas/laminas-memory if we want proven code; (3) write a small internal budget manager we own end to end. Do not introduce the archived package into a new feature.
Roadmap impact. Near zero. If a worker-stability initiative is on the roadmap, this package contributes a design reference and a short spike—not a build-vs-buy decision. Cap evaluation at one day; redirect the savings into memory observability around workers, which surfaces the problem earlier and far cheaper than an eviction layer.
How can I help you explore Laravel packages today?