New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 749785 link

Starred by 72 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocked on:
issue 753897

Blocking:
issue 727353



Sign in to add a comment

Session restore should handle large numbers of tabs gracefully

Project Member Reported by chrisha@chromium.org, Jul 27 2017

Issue description

This affects all desktop versions of Chrome.

What steps will reproduce the problem?
(1) Create a profile with a large number of open tabs (O(100+))
(2) Enable "start where I left off", and exit the browser.
(3) Open the browser.

What is the expected result?

The browser restores my tabs in a timely manner, and remains interactive during this period.

What happens instead?

The browser struggles to restore the tabs, thrashing along the way. It can take minutes before it is fully loaded and interactive.
 
Blocking: 727353
Blockedon: 753897
As part of this bug and in response to the article posted here (http://www.techradar.com/news/firefoxs-blazing-speed-with-huge-numbers-of-tabs-leaves-chrome-in-the-dust), I looked into the case where session restore occurs with 1691 tabs. When tab restoring is disabled (manual hack of code), the memory requirements are quite modest and in line with Firefox. However, it took us much more CPU to get to an interactive browser.

Profiling indicates that it's due to a poor container choice in gfx::AnimationContainer, and some O(n^2) logic in that class. Opened a separate  bug 753897 .

Comment 3 by l...@chromium.org, Aug 9 2017

Cc: l...@chromium.org

Comment 4 by borisv@chromium.org, Aug 16 2017

I have a relatively stable repro on the latest canary for tab restoring taking 100% of CPU for some tabs on Mac. It causes the CPU fans of my 2017 MacBook Pro to spin like crazy. 

It is not fully deterministic which tabs would be stuck in that state, but they are always tabs that are not active. Activating the tabs fixes the problem. I captured a 10s sample with 1ms sampling rate from one of the renderer processes that hits that state. See attached. I was also able to reproduce it on my local Release build and I am building debug build now to debug the issue better.
HighCPUUsage.log
989 KB View Download

Comment 5 by borisv@chromium.org, Aug 17 2017

I have filed a separate crbug/756311 for this problem and I am quite close to finding the root cause there.
Labels: Hotlist-TooManyTabs
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f82f2a700cdcf2e62e0836f7de3706884fdab04c

commit f82f2a700cdcf2e62e0836f7de3706884fdab04c
Author: Chris Hamilton <chrisha@chromium.org>
Date: Thu Feb 15 19:37:29 2018

Add data received notification to WebContentsObserver.

This also fixes a small bug in the UpdateTitle function. Receiving
a title is not an indication of data having been received as renderers
have code for setting an empty title before data has started to arrive.

This will be used by an upcoming component that tracks the number of
WebContents that are simultaneously loading, in order to give
session-restore's TabLoader a better view of the work being performed
on the system.

BUG=749785

Change-Id: I2fac76f18f122926af5e09f7ae41ff0d83eef225
Reviewed-on: https://chromium-review.googlesource.com/909334
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537101}
[modify] https://crrev.com/f82f2a700cdcf2e62e0836f7de3706884fdab04c/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/f82f2a700cdcf2e62e0836f7de3706884fdab04c/content/browser/web_contents/web_contents_impl_unittest.cc
[modify] https://crrev.com/f82f2a700cdcf2e62e0836f7de3706884fdab04c/content/public/browser/web_contents_observer.h

Labels: -M-64 M-69
Project Member

Comment 9 by bugdroid1@chromium.org, Mar 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477

commit 67d67a6b991cbbcbafab567c98e0fcb4fd0e4477
Author: Sigurdur Asgeirsson <siggi@chromium.org>
Date: Thu Mar 22 17:05:57 2018

Use FromCoordinationUnitBase instead of static_cast. Speling[sic] fixes.

Bug: 749785
Change-Id: Ib52b3dd62b5b5386353cdc031d57c4ac74b13410
Reviewed-on: https://chromium-review.googlesource.com/975633
Reviewed-by: lpy <lpy@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Sigurður Ásgeirsson <siggi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545121}
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/coordination_unit/coordination_unit_manager.h
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/coordination_unit/mock_coordination_unit_graphs.h
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/coordination_unit/page_coordination_unit_impl.cc
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/observers/metrics_collector.cc
[modify] https://crrev.com/67d67a6b991cbbcbafab567c98e0fcb4fd0e4477/services/resource_coordinator/observers/page_signal_generator_impl.cc

Labels: Needs-Feedback
siggi@ Could you please help us with the repro steps to verify the fix from TE end. 

Thank You...
Project Member

Comment 11 by bugdroid1@chromium.org, Apr 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22

commit 5b424b67b7f0e247a140b9e22c0b1cdcde19ab22
Author: Chris Hamilton <chrisha@chromium.org>
Date: Wed Apr 04 20:44:21 2018

Create TabLoadTracker.

This is a helper component for tracking unloaded/loading/loaded state of a tab,
abstracting away the logic from TabManager internals, and exposing it for use by
external components. A follow-up CL will modify TabLoader to use it

BUG=749785

Change-Id: I2edf254fdba190d2822f470257ea2226b459290e
Reviewed-on: https://chromium-review.googlesource.com/938970
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548185}
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/BUILD.gn
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.cc
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/resource_coordinator_web_contents_observer.h
[add] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/tab_load_tracker.cc
[add] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/tab_load_tracker.h
[add] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/tab_load_tracker_unittest.cc
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/browser/resource_coordinator/tab_manager_resource_coordinator_signal_observer.cc
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/chrome/test/BUILD.gn
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/content/public/test/web_contents_tester.h
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/content/test/test_web_contents.cc
[modify] https://crrev.com/5b424b67b7f0e247a140b9e22c0b1cdcde19ab22/content/test/test_web_contents.h

Project Member

Comment 12 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c257c23dc3b13c22d5121401cf997341ffe475f

commit 1c257c23dc3b13c22d5121401cf997341ffe475f
Author: Chris Hamilton <chrisha@chromium.org>
Date: Thu Apr 12 05:23:34 2018

Add logging of restored tab age during session restore.

Upcoming session restore changes will defer loading tabs that are beyond a certain age. This will inform the choice of that threshold.

BUG=749785

Change-Id: Ic114ee156d69373eda0fee4ccfd46570883320a2
Reviewed-on: https://chromium-review.googlesource.com/1002994
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sigurður Ásgeirsson <siggi@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550017}
[modify] https://crrev.com/1c257c23dc3b13c22d5121401cf997341ffe475f/chrome/browser/sessions/session_restore_stats_collector.cc
[modify] https://crrev.com/1c257c23dc3b13c22d5121401cf997341ffe475f/chrome/browser/sessions/session_restore_stats_collector.h
[modify] https://crrev.com/1c257c23dc3b13c22d5121401cf997341ffe475f/chrome/browser/sessions/session_restore_stats_collector_unittest.cc
[modify] https://crrev.com/1c257c23dc3b13c22d5121401cf997341ffe475f/tools/metrics/histograms/histograms.xml

Project Member

Comment 13 by bugdroid1@chromium.org, Apr 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5e6fce601213470b1e8e8bd18834eaf022148fb

commit a5e6fce601213470b1e8e8bd18834eaf022148fb
Author: Chris Hamilton <chrisha@chromium.org>
Date: Wed Apr 18 03:01:41 2018

Add logging of tab engagement score during session restore.

Upcoming session restore changes will defer loading tabs that are below a certain engagement threshold. This will inform the choice of that threshold.

BUG=749785

Change-Id: Ia356b459bd37bba734d3f152299c4155aee6fe70
Reviewed-on: https://chromium-review.googlesource.com/1004918
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551563}
[modify] https://crrev.com/a5e6fce601213470b1e8e8bd18834eaf022148fb/chrome/browser/sessions/session_restore_stats_collector.cc
[modify] https://crrev.com/a5e6fce601213470b1e8e8bd18834eaf022148fb/chrome/browser/sessions/session_restore_stats_collector.h
[modify] https://crrev.com/a5e6fce601213470b1e8e8bd18834eaf022148fb/chrome/browser/sessions/session_restore_stats_collector_unittest.cc
[modify] https://crrev.com/a5e6fce601213470b1e8e8bd18834eaf022148fb/tools/metrics/histograms/histograms.xml

Comment 14 by ojan@chromium.org, May 8 2018

Cc: -ojan@chromium.org
Project Member

Comment 15 by bugdroid1@chromium.org, Jun 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b0f670152a7ab4440512d2370b9c40c8d66091a

commit 6b0f670152a7ab4440512d2370b9c40c8d66091a
Author: Chris Hamilton <chrisha@chromium.org>
Date: Tue Jun 05 12:57:15 2018

Migrate TabLoader to use TabLoadTracker.

This cleans up the TabLoader code by removing use of notification
registrars, etc. It also changes behaviour in one significant way
by introducing "loading slots", which enforces a cap on the number
of simultaneous loads that occur. In the previous TabLoader, this
would effectively be equal to the number of active tabs + the number
of timed out tabs. The new system imposes a soft-cap that can be
temporarily exceeded by timed out tabs and active tabs, but which
is otherwise enforced.

BUG=749785

Change-Id: Ib8fb091b4cb39c93854ef91073dfa2a5c47889d6
Reviewed-on: https://chromium-review.googlesource.com/1071713
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564465}
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/BUILD.gn
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/session_restore_observer_unittest.cc
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_loader.cc
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_loader.h
[add] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_loader_tester.cc
[add] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_loader_tester.h
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_loader_unittest.cc
[modify] https://crrev.com/6b0f670152a7ab4440512d2370b9c40c8d66091a/chrome/browser/sessions/tab_restore_browsertest.cc

Labels: TE-Verified-69.0.3451.0 TE-Verified-M69
Verified this issue on Windows 10, Debian Rodete and Mac 10.13.4 with chrome #69.0.3451.0, as per steps mentioned in the comment #0
Observed that for 150+ new tabs browser restores tabs in timely manner.Hence adding TE Verified labels

Attaching the screen-cast for reference.


749785.mp4
1.0 MB View Download
Project Member

Comment 18 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc0d13f3b8651d60201dd93a77239b35a41d5fa1

commit cc0d13f3b8651d60201dd93a77239b35a41d5fa1
Author: Chris Hamilton <chrisha@chromium.org>
Date: Fri Jun 08 01:28:04 2018

Create SessionRestorePolicy.

This encapsulates policy logic for the upcoming session restore
refinements and the related experiments.

BUG=749785

Change-Id: Ib9b26363b85d3082fd27dec6db78679a23e919a8
Reviewed-on: https://chromium-review.googlesource.com/1091239
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565500}
[modify] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/BUILD.gn
[add] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/session_restore_policy.cc
[add] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/session_restore_policy.h
[add] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/session_restore_policy_unittest.cc
[modify] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc
[modify] https://crrev.com/cc0d13f3b8651d60201dd93a77239b35a41d5fa1/chrome/test/BUILD.gn

Project Member

Comment 20 by bugdroid1@chromium.org, Jun 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/488c1a93b176d6f4947112e3487878d49786c092

commit 488c1a93b176d6f4947112e3487878d49786c092
Author: Chris Hamilton <chrisha@chromium.org>
Date: Tue Jun 12 01:51:19 2018

Add policy to TabLoaderDelegate and integrate with TabLoader.

This integrates the resource_coordinator::SessionRestorePolicy into
TabLoaderDelegate, and performs the necessary plumbing in TabLoader.
This enables fine-grained changes to session restore logic in support
of extremely large session restores.

BUG=749785

Change-Id: I86682d199e0b4f1a2d57622bf98a572a9f13eba3
Reviewed-on: https://chromium-review.googlesource.com/1093020
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566252}
[modify] https://crrev.com/488c1a93b176d6f4947112e3487878d49786c092/chrome/browser/sessions/tab_loader.cc
[modify] https://crrev.com/488c1a93b176d6f4947112e3487878d49786c092/chrome/browser/sessions/tab_loader.h
[modify] https://crrev.com/488c1a93b176d6f4947112e3487878d49786c092/chrome/browser/sessions/tab_loader_delegate.cc
[modify] https://crrev.com/488c1a93b176d6f4947112e3487878d49786c092/chrome/browser/sessions/tab_loader_delegate.h
[modify] https://crrev.com/488c1a93b176d6f4947112e3487878d49786c092/chrome/browser/sessions/tab_loader_unittest.cc

Cc: georgesak@chromium.org marja@chromium.org chrisha@chromium.org
 Issue 32061  has been merged into this issue.
Labels: Hotlist-ConOps
siggi@ Could you please help us with the repro steps to verify the fix from TE end. 

Thank You...
https://bazaarreview.com/best-wireless-routers/
Anyone going to remove the spammer?

Sign in to add a comment