Hi
Contact emails
har...@chromium.org, ta...@chromium.org
Spec
None.
Summary
When the system is under high memory pressure, purge as much memory as possible from background tabs and suspend them (Design document)
Motivation
Imagine that the OS is under high memory pressure and Chrome is running 1 foreground tab and N background tabs. The most efficient way to reduce the memory would be to purge memory from the N background tabs.
With that motivation in mind, we propose purge + suspend. Specifically, we purge as much memory as possible and then immediately suspend the backgrounded tabs (in order not to let the purged memory come back). This may break web compatibility because the suspended tabs stop running (e.g., favicon update, tab title update, notifications). To mitigate the concern, we resume the suspended tabs periodically (e.g., 2 mins).
tasak@ implemented the prototype and collected performance/memory numbers. The high-level summary is as follows:
In average, the purge + suspend reduced 28% of renderer's memory. In particular, it reduced 72% from Facebook and 61% from Tumblur. The number looks very promising.
In average, the number stays at 28% even after (periodically) resuming the suspended tab. This means that periodic resuming doesn't resurrect much memory in common websites. There are a couple of websites (e.g. Google Drive, Yahoo) where periodic resuming resurrects a lot of memory, but the resurrected memory is gone when the renderer is purged again.
To evaluate the tab-switching cost, we manually created a custom Chrome that forcibly suspends all background tabs every 1 second and crawled many websites. However, we didn't observe any UX regression.
See this document for more detailed performance/memory analysis.
Interoperability and Compatibility Risk
First of all, we blacklist tabs that are playing video, audio etc using the mechanism of the existing tab-discarding. Second, we give the suspended tabs a chance to wake up periodically so that the tabs can update favicons, tab titles, notifications etc.
Remember that the tab-suspension may break compatibility, but at the very least it will provide a much better UX than the existing tab-discarding in terms of both compatibility and tab-switching cost.
Ongoing technical constraints
Experiments are needed to optimize heuristics to determine the purging targets (work-in-progress CL) and the timings. Our plan is to start a Finch experiment, collect more performance/memory numbers from the wild, and optimize the heuristics.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes. On all platforms that have background tabs.
OWP launch tracking bug
Requesting approval to ship?
Yes. As mentioned above, we want to start a Finch experiment to collect more performance/memory numbers and optimize the heuristics.
How would this impact a site that uses long polling for things like chat? Even if the tabs are woken up frequently the experience of having chat messages be delayed by 2 minutes could be pretty bad.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Hi
Contact emails
har...@chromium.org, ta...@chromium.org
Spec
None.
Summary
When the system is under high memory pressure, purge as much memory as possible from background tabs and suspend them (Design document)
Motivation
Imagine that the OS is under high memory pressure and Chrome is running 1 foreground tab and N background tabs. The most efficient way to reduce the memory would be to purge memory from the N background tabs.
With that motivation in mind, we propose purge + suspend. Specifically, we purge as much memory as possible and then immediately suspend the backgrounded tabs (in order not to let the purged memory come back). This may break web compatibility because the suspended tabs stop running (e.g., favicon update, tab title update, notifications). To mitigate the concern, we resume the suspended tabs periodically (e.g., 2 mins).
tasak@ implemented the prototype and collected performance/memory numbers. The high-level summary is as follows:
In average, the purge + suspend reduced 28% of renderer's memory. In particular, it reduced 72% from Facebook and 61% from Tumblur. The number looks very promising.
In average, the number stays at 28% even after (periodically) resuming the suspended tab. This means that periodic resuming doesn't resurrect much memory in common websites.
There are a couple of websites (e.g. Google Drive, Yahoo) where periodic resuming resurrects a lot of memory, but the resurrected memory is gone when the renderer is purged again.
Hi,Do you intend to purge and suspend more aggressively than the current tab discarder? Assuming so; if so what are the conditions?
Also, a followup to Ben Maurer's comment: by "notification" do you mean push notification or similar? A long polling system would not have one of those.
On Tue, Aug 9, 2016 at 3:37 PM Kentaro Hara <har...@chromium.org> wrote:Hi
Contact emails
har...@chromium.org, ta...@chromium.org
Spec
None.
Summary
When the system is under high memory pressure, purge as much memory as possible from background tabs and suspend them (Design document)
Motivation
Imagine that the OS is under high memory pressure and Chrome is running 1 foreground tab and N background tabs. The most efficient way to reduce the memory would be to purge memory from the N background tabs.
With that motivation in mind, we propose purge + suspend. Specifically, we purge as much memory as possible and then immediately suspend the backgrounded tabs (in order not to let the purged memory come back). This may break web compatibility because the suspended tabs stop running (e.g., favicon update, tab title update, notifications). To mitigate the concern, we resume the suspended tabs periodically (e.g., 2 mins).
tasak@ implemented the prototype and collected performance/memory numbers. The high-level summary is as follows:
The link to the performance numbers seems to have expired.
In average, the purge + suspend reduced 28% of renderer's memory. In particular, it reduced 72% from Facebook and 61% from Tumblur. The number looks very promising.
In average, the number stays at 28% even after (periodically) resuming the suspended tab. This means that periodic resuming doesn't resurrect much memory in common websites.
In that case why does the resuming need to be periodic?
There are a couple of websites (e.g. Google Drive, Yahoo) where periodic resuming resurrects a lot of memory, but the resurrected memory is gone when the renderer is purged again.
How frequently do these sites actually resume -- do they have timers that execute every period? Sounds like we will end up burning more CPU+battery on such sites.
To evaluate the tab-switching cost, we manually created a custom Chrome that forcibly suspends all background tabs every 1 second and crawled many websites. However, we didn't observe any UX regression.
See this document for more detailed performance/memory analysis.
Interoperability and Compatibility Risk
First of all, we blacklist tabs that are playing video, audio etc using the mechanism of the existing tab-discarding. Second, we give the suspended tabs a chance to wake up periodically so that the tabs can update favicons, tab titles, notifications etc.
Remember that the tab-suspension may break compatibility, but at the very least it will provide a much better UX than the existing tab-discarding in terms of both compatibility and tab-switching cost.
Ongoing technical constraints
Experiments are needed to optimize heuristics to determine the purging targets (work-in-progress CL) and the timings. Our plan is to start a Finch experiment, collect more performance/memory numbers from the wild, and optimize the heuristics.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes. On all platforms that have background tabs.
OWP launch tracking bug
Requesting approval to ship?
Yes. As mentioned above, we want to start a Finch experiment to collect more performance/memory numbers and optimize the heuristics.
--Kentaro Hara, Tokyo, Japan
I think the issue here is that a tab like this would not actually get push notifications (since they'd be delivered via direct communication with the server). One possible approach would be to disable the discarding for tabs that have actively been making network requests. But that may fail on sites that do various types of background updates.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
How about sound streaming? I use YouTube as a jukebox and which is always in background.
Ping sound from a background hanguout page is also very useful and instancy is very important.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Why does the memory not go back up when we resume?
What are we discarding that stays discarded?
hm. the design doc refers to chrome://discards as the place to get info on tab discarding, but I can't find that in any of my (Linux) browsers.How do I tell that tab discarding is running in my browsers?(FWIW, I regularly kill off multi-gigabyte tabs - they seem to make Chrome slow, even when there's plenty of RAM on the machine.)
Why does the memory not go back up when we resume?Note that we're just resuming the tab in background and processing pending tasks in the task queue. So CC's memory won't come back.
You might want to open the "Total" column of tasak's result. In average, memory doesn't come back when the tab is resumed, but a non-trivial amount of memory comes back in a couple of websites (e.g., Google Drive, Yahoo) (although the memory is gone when the tab is purged again).What are we discarding that stays discarded?Hmm, what do you mean?
On Wed, Aug 10, 2016 at 4:20 PM, Harald Alvestrand <h...@google.com> wrote:hm. the design doc refers to chrome://discards as the place to get info on tab discarding, but I can't find that in any of my (Linux) browsers.How do I tell that tab discarding is running in my browsers?(FWIW, I regularly kill off multi-gigabyte tabs - they seem to make Chrome slow, even when there's plenty of RAM on the machine.)+chrisha +georgesak: Do you have any idea on this?
On Wed, Aug 10, 2016 at 4:57 AM, Kentaro Hara <har...@chromium.org> wrote:Why does the memory not go back up when we resume?Note that we're just resuming the tab in background and processing pending tasks in the task queue. So CC's memory won't come back.But we should already discard cc memory in background tabs under memory pressure. What's different about this purge system?
You might want to open the "Total" column of tasak's result. In average, memory doesn't come back when the tab is resumed, but a non-trivial amount of memory comes back in a couple of websites (e.g., Google Drive, Yahoo) (although the memory is gone when the tab is purged again).What are we discarding that stays discarded?Hmm, what do you mean?You're saying letting the website run script every 2m on average doesn't make it reclaim all of the memory. Some part of the picture seems to be missing though, since we should already discard cc memory in background tabs, is there a cc bug here?
Getting back to the original point, are there any concerns to be resolved before starting a Finch experiment of the purge + suspend?
Hi
I would like to report our Purge+suspend finch experiment’s result. The finch experiment started on December, 2016 with the following configuration:
platform: Linux, Windows, MacOS and ChromeOS
milestone: 57
channel: dev and canary
Summary
Since we found that Purge+Suspend can break many web sites, we have decided to go with a simpler approach: Purge+Throttle. The idea is just to periodically send purge notifications to background renderers that have been already throttled by the Blink Scheduler.The new design is https://docs.google.com/document/d/1L5qRmCwjidiZWKmQRiuqMjZivBWV7XSW9RTypg9XxlI/edit?usp=sharing.
We enabled Purge+Throttle in a Finch experiment and got the following results:
The purge notifications change 50th percentile of total memory usages from 61.0MB(control) to 52.9MB(experiment) (-13.3%). 75th percentile is 125.0(control) and 112.5(experiment). We can expect that the notifications save about 8 - 13MB memory per renderer on the average. This is high impact.
The purge notifications change 50th percentile of tab switching cost from 19.5m to 21.8ms. This shouldn't be a user-visible regression. Not that the regression happens only on a tab that has been backgrounded for >20 mins.
c.f.
Compare Purge+Throttle memory usage vs Control’s after purging: https://docs.google.com/spreadsheets/d/1VbEI_yQ_0InlWYW-fxxniM4nB3YeAffUHgq-GOaf-lA/pubchart?oid=85121757&format=interactive
Compare Purge+Throttle time-to-first-active-paint vs Control’s:
c.f. memory growth after purging
Purge+Throttle will be eventually integrated into MemoryCoordinator. The current heuristics of Purge+Throttle is very simple, but in the future MemoryCoordinator will monitor backgrounded renderers and will purge the memory caches more smartly.
--
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM2
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
LGTM2
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
"We enabled Purge+Throttle in a Finch experiment and got the following results:
The purge notifications change 50th percentile of total memory usages from 61.0MB(control) to 52.9MB(experiment) (-13.3%). 75th percentile is 125.0(control) and 112.5(experiment). We can expect that the notifications save about 8 - 13MB memory per renderer on the average. This is high impact.
The purge notifications change 50th percentile of tab switching cost from 19.5m to 21.8ms. This shouldn't be a user-visible regression. Not that the regression happens only on a tab that has been backgrounded for >20 mins."
LGTM2
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Should we expect the memory savings from purge+throttle to be similar?
Should there be a reverse finch experiment to verify that in case guesses are wrong?
LGTM2
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM2
LGTM!
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.