mirror of
https://github.com/daijro/camoufox.git
synced 2026-10-03 00:00:16 +00:00
When a content process crashes, Juggler disposes the page's target,
which drops it from its browser context. Nothing closed the tab after
that: BrowserContext.destroy() only closes the pages it still tracks,
and the default context closes none. Every crashed page kept its
browser window until the browser exited, 15-60 MB of parent RSS each,
growing without bound across crashes. Playwright's own Juggler has the
same code and the same leak.
The crashed tab is now closed on the next tick after the crash is
handled. A persistent launch has no -silent survival area, so closing
its last window would quit the browser; there the crashed tab is kept
until another tab opens.
test_the_parent_stays_flat_across_content_crashes passed while leaking.
#785's warm-up moved its baseline past the first context's 150-200 MB,
which left three crashes' worth of this leak under the 400 MB bound.
It now compares 8 context cycles with a content crash each against 8
without, after two warm-up cycles, and fails if the crashes add 100 MB
or more. Both numbers print on every run.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit bfd93987c6)