Doctrine ORM 2.14: Clearing the identity map to mitigate memory growth
Goal In a long‑running PHP script that loads thousands of entities, memory usage climbs linearly due to the Unit of Work’s identity map. The goal is to keep memory usage stable while still being able to reuse some entity instances. Constraints Calling EntityManager::clear() removes all managed entities, which can break subsequent code that expects those obje