On desktop, tab manager has to do a full unload of a tab (including running its unload handle) on desktop platforms, if that tab has an unload handler. A quick glance at histograms suggests this means that about 80% of tabs have to do a full unload. Put another way, right now, 80% of all tab kills have to run substantial amounts of blink/v8/js code in order to shut down a tab in response to memory pressure. Best practices for critical memory pressure are to rapidly respond to the memory pressure, as fast as possible.We should modify our behavior
On Android, we already skip unload logic during critical memory pressure situations. But, this is accidental rather than intentional: on Android, the OS just fast kills processes directly when it reaches a critical state, without routing through the tab manager. Whereas, on other platforms, our code is involved, and our current handling errs in favor of not breaking content.
The change this bug proposes is, on critical memory pressure, on all platforms, to skip running unload/beforeunload handlers.
Comment 1 by nduca@chromium.org
, Jun 8 2017Labels: -Pri-3 M-61 Pri-1