You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A cycle through a closure's capture (object -> closure property -> captured object) is not collected by gc_collect_cycles(). #246
Known-bug repro: tests/aot/repro/leak/closure_capture_cycle_not_collected.php — bash tests/aot/xfail.sh -k closure_capture_cycle_not_collected reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Root of the per-request growth of a shared-Kernel Symfony app under Http\Server (~7-8 KB/request): AbstractSessionListener::onKernelRequest does $request->setSessionFactory(function () use ($request) {...}) on every main request, so each Request sits in a Request -> Closure -> Request cycle. leaks --atExit on the server (workers 0, 1000 requests) attributes 2.8 MB to that closure allocation, with the Request graph (HeaderBag arrays, strtr keys, ...) under it. Adding gc_collect_cycles() every 1000 requests frees 0 objects and RSS stays at +8.4 KB/request: the collector walks only rc obj properties, closures are excluded (their header and capture layout are not cycle nodes, see EmitLlvmRuntime per-class child walker comment). Fix needs closures as Bacon-Rajan nodes (colour bits, capture walker, white free) and add_root on closure release.
Activity
blacktrs commentedon Oct 13, 2026
Root of the per-request growth of a shared-Kernel Symfony app under Http\Server (~7-8 KB/request):
AbstractSessionListener::onKernelRequestdoes$request->setSessionFactory(function () use ($request) {...})on every main request, so each Request sits in a Request -> Closure -> Request cycle.leaks --atExiton the server (workers 0, 1000 requests) attributes 2.8 MB to that closure allocation, with the Request graph (HeaderBag arrays, strtr keys, ...) under it. Addinggc_collect_cycles()every 1000 requests frees 0 objects and RSS stays at +8.4 KB/request: the collector walks only rc obj properties, closures are excluded (their header and capture layout are not cycle nodes, see EmitLlvmRuntime per-class child walker comment). Fix needs closures as Bacon-Rajan nodes (colour bits, capture walker, white free) and add_root on closure release.Repro #246: a cycle through a closure capture is not collected
Collect cycles through a Closure capture: the env is a transparent ed…