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

Issue 635419 link

Starred by 12 users

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 722792



Sign in to add a comment

Ship purge + suspend

Project Member Reported by haraken@chromium.org, Aug 8 2016

Issue description

We should ship purge + suspend, which purges as much memory as possible from background renderers and suspend them.

Design doc: https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit

Performance/memory results: https://docs.google.com/document/d/10LqrNpXKNbcAetDX81phpRulKJdS1BSkwIFJMKCWre4/edit#

Work-in-progress CL: https://codereview.chromium.org/2130683002/

Summary:

- Looking at Total, purge+suspend reduced 28% of renderer’s memory in average. The number stays at 28% after resuming, which means that resuming didn’t reclaim much memory average.

- There are a couple of sites (e.g. Google Drive, Yahoo) where resuming reclaims a lot of memory. However, the memory is purged when purging the renderer again.

- It is amazing that 72% of renderer’s memory was dropped in Facebook. This is because Facebook is using a lot of memory in CC and we can drop it when purging (because CC is not necessary for suspended background renderers).


 
cc should already discard memory in background tabs under pressure. This
seems like maybe a bug?
Cc: -esprehn@chromium.org ericrk@chromium.org
+ericrk: Do you have any thoughts on comment #1?

Comment 3 by tasak@google.com, Aug 25 2016

Status: Assigned (was: Untriaged)
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 25 2016

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

commit 2635c95b75dd28be2678f1e4d61f72ff46192d27
Author: tasak <tasak@google.com>
Date: Thu Aug 25 12:21:59 2016

Make PendingScript MemoryCoordinatorClient:

- implement prepareToSuspend for background renderer's purge + suspend. prepareToSuspend is invoked before a background renderer is suspended.
- PendingScript's prepareToSuspend cancels ScriptStreaming.
- intent-to-implement-and-ship of background renderer's purge + suspend is https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing

BUG=635419

Review-Url: https://codereview.chromium.org/2268153002
Cr-Commit-Position: refs/heads/master@{#414404}

[modify] https://crrev.com/2635c95b75dd28be2678f1e4d61f72ff46192d27/third_party/WebKit/Source/core/dom/PendingScript.cpp
[modify] https://crrev.com/2635c95b75dd28be2678f1e4d61f72ff46192d27/third_party/WebKit/Source/core/dom/PendingScript.h

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 25 2016

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

commit 17888b419ca845a6762aae5287b449424997cc88
Author: tasak <tasak@google.com>
Date: Thu Aug 25 13:59:59 2016

Make Resource MemoryCoordinatorClient:

- implement prepareToSuspend for background renderer's purge + suspend. prepareToSuspend is invoked before a background renderer is suspended.
- intent-to-implement-and-ship of background renderer's purge + suspend is https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing

BUG=635419

Review-Url: https://codereview.chromium.org/2249373002
Cr-Commit-Position: refs/heads/master@{#414425}

[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunnerTest.cpp
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/core/fetch/CachedMetadataHandler.h
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/core/fetch/Resource.cpp
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/core/fetch/Resource.h
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.cpp
[modify] https://crrev.com/17888b419ca845a6762aae5287b449424997cc88/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerScriptCachedMetadataHandler.h

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 15 2016

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

commit e7ac1bbe93e087b173d503ca13b1e3b6f703b785
Author: tasak <tasak@google.com>
Date: Thu Sep 15 11:12:57 2016

Make cc::SoftwareImageDecodeController, cc::GpuImageDecodeController, cc::ResourcePool, and cc::StagingBufferPool MemoryCoordinatorClient.

- implement OnMemoryStateChange for background renderer's purge +
  suspend. So the method reduces memory only when state == SUSPENDED.
- intent-to-implement-and-ship of background renderer's purge + suspend is
  https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing

BUG=635419
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2286583002
Cr-Commit-Position: refs/heads/master@{#418834}

[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/raster/staging_buffer_pool.cc
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/raster/staging_buffer_pool.h
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/resources/resource_pool.cc
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/resources/resource_pool.h
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/tiles/gpu_image_decode_controller.cc
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/tiles/gpu_image_decode_controller.h
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/tiles/software_image_decode_controller.cc
[modify] https://crrev.com/e7ac1bbe93e087b173d503ca13b1e3b6f703b785/cc/tiles/software_image_decode_controller.h

Project Member

Comment 7 by bugdroid1@chromium.org, Sep 26 2016

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

commit 0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22
Author: ericrk <ericrk@chromium.org>
Date: Mon Sep 26 22:16:19 2016

Implement OnMemoryStateChange for Various CC Classes

Adds SUSPENDED handling for:
cc::ResourcePool
cc::GpuImageDecodeController
cc::StagingBufferPool

Additionally adds THROTTLED handling for:
cc::GpuImageDecodeController

Additional THROTTLED handling will be added in a follow-up CL.

R=vmpstr
BUG=635419
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel

Review-Url: https://codereview.chromium.org/2367953002
Cr-Commit-Position: refs/heads/master@{#421018}

[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/raster/staging_buffer_pool.cc
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/resources/resource_pool.cc
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/resources/resource_pool.h
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/resources/resource_pool_unittest.cc
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/tiles/gpu_image_decode_controller.cc
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/tiles/gpu_image_decode_controller.h
[modify] https://crrev.com/0cbb20ce38c9fc1a7b57526a5c16b1d325ae3e22/cc/tiles/gpu_image_decode_controller_unittest.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Oct 17 2016

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

commit c69e250806f8b33ef6375f557911a52e1542e178
Author: tasak <tasak@google.com>
Date: Mon Oct 17 06:08:48 2016

Invoke CanSuspendBackgroundedRenderer in TabManager::PurgeAndSuspendBackgroundedTabs.

- intent-to-implement-and-ship of background renderer's purge + suspend
  is
   https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
    https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because
  purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2418763003
Cr-Commit-Position: refs/heads/master@{#425623}

[modify] https://crrev.com/c69e250806f8b33ef6375f557911a52e1542e178/chrome/browser/memory/tab_manager.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Oct 17 2016

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

commit a3ed913e99d2d9acf6413ae56e1c8d1da4382522
Author: tasak <tasak@google.com>
Date: Mon Oct 17 07:21:00 2016

Record PendingTaskCount when a backgrounded renderer is suspended.

To understand PurgeAndSuspend, we need to see how many tasks are still
in task_queues when a backgrounded renderer is suspended.

- intent-to-implement-and-ship of background renderer's purge + suspend is
 https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
 - one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
  - The feature is not enabled by default because purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2416803003
Cr-Commit-Position: refs/heads/master@{#425627}

[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/child/compositor_worker_scheduler.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper.h
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/child/scheduler_helper_unittest.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/third_party/WebKit/public/platform/scheduler/base/task_queue.h
[modify] https://crrev.com/a3ed913e99d2d9acf6413ae56e1c8d1da4382522/tools/metrics/histograms/histograms.xml

Project Member

Comment 10 by bugdroid1@chromium.org, Oct 18 2016

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

commit b46626af32c274cbb8f0eaad63237e7d339c0a7b
Author: tasak <tasak@google.com>
Date: Tue Oct 18 05:54:44 2016

Add UMA for PurgeAndSuspend.

- Report memory usage after purging cached memory of a backgrounded renderer.
- intent-to-implement-and-ship of background renderer's purge + suspend is
 https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
 https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2391423004
Cr-Commit-Position: refs/heads/master@{#425894}

[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/content/child/child_discardable_shared_memory_manager.cc
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/content/child/child_discardable_shared_memory_manager.h
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/content/renderer/render_thread_impl.h
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/third_party/WebKit/Source/web/BUILD.gn
[add] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/third_party/WebKit/Source/web/WebMemoryStatistics.cpp
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/third_party/WebKit/public/BUILD.gn
[add] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/third_party/WebKit/public/web/WebMemoryStatistics.h
[modify] https://crrev.com/b46626af32c274cbb8f0eaad63237e7d339c0a7b/tools/metrics/histograms/histograms.xml

Project Member

Comment 11 by bugdroid1@chromium.org, Oct 21 2016

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

commit 07465a7afd1dc3d5ba41c7772c3278292934ff30
Author: tasak <tasak@google.com>
Date: Fri Oct 21 06:38:52 2016

Should reset record_purge_suspend_metric_closure_ CancelableCallback in OnProcessBackgrounded after cancelled.

BUG=635419

Review-Url: https://chromiumcodereview.appspot.com/2437543002
Cr-Commit-Position: refs/heads/master@{#426738}

[modify] https://crrev.com/07465a7afd1dc3d5ba41c7772c3278292934ff30/content/renderer/render_thread_impl.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Oct 26 2016

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

commit c51591267f94eb168c842bc3a7da44ad81aac84f
Author: tasak <tasak@google.com>
Date: Wed Oct 26 06:09:05 2016

Add ResumeRenderer to RendererScheduler for Purge+Suspend.

- To avoid breaking web, we need to resume a backgrounded renderer that
  was purged and suspended.
- intent-to-implement-and-ship of background renderer's purge + suspend
  is
   https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because
  purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2442663002
Cr-Commit-Position: refs/heads/master@{#427606}

[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h
[modify] https://crrev.com/c51591267f94eb168c842bc3a7da44ad81aac84f/third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h

Project Member

Comment 14 by bugdroid1@chromium.org, Oct 28 2016

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

commit a079ac4eebb754e20ce651d4e593286c630ab368
Author: tasak <tasak@google.com>
Date: Fri Oct 28 03:10:19 2016

Expose Resume() in RenderProcessHost.

- The Resume() is used for purge+suspend.
- intent-to-implement-and-ship of background renderer's purge + suspend
  is
  https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because
  purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2453713002
Cr-Commit-Position: refs/heads/master@{#428266}

[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/browser/renderer_host/render_process_host_impl.h
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/child/child_thread_impl.cc
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/child/child_thread_impl.h
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/common/child_process_messages.h
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/public/browser/render_process_host.h
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/public/test/mock_render_process_host.cc
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/public/test/mock_render_process_host.h
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/a079ac4eebb754e20ce651d4e593286c630ab368/content/renderer/render_thread_impl.h

Project Member

Comment 15 by bugdroid1@chromium.org, Nov 2 2016

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

commit 8241a62d2ba05a3c1d55d0e087986b637658892b
Author: tasak <tasak@google.com>
Date: Wed Nov 02 06:32:17 2016

Add Resume logic of Purge+Suspend to TabManager.

- To avoid breaking web, we need to resume a backgrounded renderer that
  was purged and suspended.
  (A backgrounded renderer is suspended for 120seconds).
  After resumed, the renderer is running for 10 seconds and is purged
  and suspended again.
- intent-to-implement-and-ship of background renderer's purge +
  suspend is
  https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because
  purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2462513002
Cr-Commit-Position: refs/heads/master@{#429222}

[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager.cc
[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager.h
[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager_unittest.cc
[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager_web_contents_data.cc
[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager_web_contents_data.h
[modify] https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Nov 2 2016

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

commit 5af515953863b831c317fdbc70b8254e1784bff7
Author: kjellander <kjellander@chromium.org>
Date: Wed Nov 02 08:13:29 2016

Revert of Add Resume logic of Purge+Suspend to TabManager. (patchset #3 id:60001 of https://codereview.chromium.org/2462513002/ )

Reason for revert:
Reliably breaks Linux ChromiumOS Tests (1): https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/28780 and Linux ChromiumOS Tests (dbg)(1): https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/19523

Original issue's description:
> Add Resume logic of Purge+Suspend to TabManager.
>
> - To avoid breaking web, we need to resume a backgrounded renderer that
>   was purged and suspended.
>   (A backgrounded renderer is suspended for 120seconds).
>   After resumed, the renderer is running for 10 seconds and is purged
>   and suspended again.
> - intent-to-implement-and-ship of background renderer's purge +
>   suspend is
>   https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
> - one of the documents attached in the above intent is
>   https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
> - The feature is not enabled by default because
>   purge-and-suspend-time is 0.
>
> BUG=635419
>
> Committed: https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b
> Cr-Commit-Position: refs/heads/master@{#429222}

TBR=haraken@chromium.org,chrisha@chromium.org,tasak@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=635419

Review-Url: https://codereview.chromium.org/2470073002
Cr-Commit-Position: refs/heads/master@{#429237}

[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager.cc
[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager.h
[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager_unittest.cc
[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager_web_contents_data.cc
[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager_web_contents_data.h
[modify] https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 2 2016

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

commit 4435d0191470e3e33d3edfa0594cd9de7102a331
Author: tasak <tasak@google.com>
Date: Wed Nov 02 09:22:31 2016

Reland of Add Resume logic of Purge+Suspend to TabManager. (patchset #1 id:1 of https://codereview.chromium.org/2470073002/ )

Reason for revert:
Because the change added by the reverted patch is not enabled by default.

Original issue's description:
> Revert of Add Resume logic of Purge+Suspend to TabManager. (patchset #3 id:60001 of https://codereview.chromium.org/2462513002/ )
>
> Reason for revert:
> Reliably breaks Linux ChromiumOS Tests (1): https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%281%29/builds/28780 and Linux ChromiumOS Tests (dbg)(1): https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Tests%20%28dbg%29%281%29/builds/19523
>
> Original issue's description:
> > Add Resume logic of Purge+Suspend to TabManager.
> >
> > - To avoid breaking web, we need to resume a backgrounded renderer that
> >   was purged and suspended.
> >   (A backgrounded renderer is suspended for 120seconds).
> >   After resumed, the renderer is running for 10 seconds and is purged
> >   and suspended again.
> > - intent-to-implement-and-ship of background renderer's purge +
> >   suspend is
> >   https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
> > - one of the documents attached in the above intent is
> >   https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
> > - The feature is not enabled by default because
> >   purge-and-suspend-time is 0.
> >
> > BUG=635419
> >
> > Committed: https://crrev.com/8241a62d2ba05a3c1d55d0e087986b637658892b
> > Cr-Commit-Position: refs/heads/master@{#429222}
>
> TBR=haraken@chromium.org,chrisha@chromium.org,tasak@google.com
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=635419
>
> Committed: https://crrev.com/5af515953863b831c317fdbc70b8254e1784bff7
> Cr-Commit-Position: refs/heads/master@{#429237}

TBR=haraken@chromium.org,chrisha@chromium.org,kjellander@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=635419

Review-Url: https://codereview.chromium.org/2471613003
Cr-Commit-Position: refs/heads/master@{#429243}

[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager.cc
[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager.h
[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager_unittest.cc
[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager_web_contents_data.cc
[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager_web_contents_data.h
[modify] https://crrev.com/4435d0191470e3e33d3edfa0594cd9de7102a331/chrome/browser/memory/tab_manager_web_contents_data_unittest.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Nov 7 2016

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

commit 6ff44039ad107d09e4abd791dbb2d61358657600
Author: tasak <tasak@google.com>
Date: Mon Nov 07 06:45:25 2016

Purge memory via MemoryCoordinatorClientRegistry when a backgrounded renderer is suspended.

- Added kPurgeAndSuspend to content feature list.
- If kPurgeAndSuspend is enabled, purge memory and suspend.
  Otherwise, do nothing except recording UMA.

- intent-to-implement-and-ship of background renderer's purge +
  suspend is
  https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4
- one of the documents attached in the above intent is
  https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing
- The feature is not enabled by default because
  purge-and-suspend-time is 0.

BUG=635419

Review-Url: https://codereview.chromium.org/2456073003
Cr-Commit-Position: refs/heads/master@{#430225}

[modify] https://crrev.com/6ff44039ad107d09e4abd791dbb2d61358657600/content/public/common/content_features.cc
[modify] https://crrev.com/6ff44039ad107d09e4abd791dbb2d61358657600/content/public/common/content_features.h
[modify] https://crrev.com/6ff44039ad107d09e4abd791dbb2d61358657600/content/renderer/render_thread_impl.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Jan 19 2017

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

commit 72f64044b4e3a3826cc449c19c9e5947f931c667
Author: tasak <tasak@google.com>
Date: Thu Jan 19 14:02:53 2017

memory metrics: record growth after purging BG renderer's cache

Record memory growth of each allocator / total memory growth 5 minutes, 10 minutes and 15 minutes after a backgrounded renderer is purged.

BUG=635419

Review-Url: https://codereview.chromium.org/2636873002
Cr-Commit-Position: refs/heads/master@{#444722}

[modify] https://crrev.com/72f64044b4e3a3826cc449c19c9e5947f931c667/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/72f64044b4e3a3826cc449c19c9e5947f931c667/content/renderer/render_thread_impl.h
[modify] https://crrev.com/72f64044b4e3a3826cc449c19c9e5947f931c667/tools/metrics/histograms/histograms.xml

Project Member

Comment 20 by bugdroid1@chromium.org, Jan 31 2017

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

commit 9b2c7feef5c429664a83c15dc9b1508d741e030d
Author: tasak <tasak@google.com>
Date: Tue Jan 31 19:40:34 2017

Fix PurgeAndSuspend.MemoryGrowth.* UMA.

The reported value's unit is "KB" but UMA_HISTOGRAM_MEMORY_MB is used.
Should use UMA_HISTOGRAM_MEMORY_KB.

BUG=635419

Review-Url: https://codereview.chromium.org/2663733002
Cr-Commit-Position: refs/heads/master@{#447301}

[modify] https://crrev.com/9b2c7feef5c429664a83c15dc9b1508d741e030d/content/renderer/render_thread_impl.cc

Project Member

Comment 21 by bugdroid1@chromium.org, Feb 8 2017

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

commit 235cb99dc91534cc729e07a7b1ca5878ee57fcf5
Author: tasak <tasak@google.com>
Date: Wed Feb 08 10:19:01 2017

Should not invalidate font cache for purge+suspend.

Invalidating font cache for purge+suspend always causes full layout
when the tab is foregrounded. The full layout increases tab-switching cost
significantly (observed when browsing en.wikipedia.org/wiki/wikipedia).
So we should not invoke fontCache()->invalidate() when purge+suspended.

BUG=635419

Review-Url: https://codereview.chromium.org/2680713002
Cr-Commit-Position: refs/heads/master@{#448944}

[modify] https://crrev.com/235cb99dc91534cc729e07a7b1ca5878ee57fcf5/third_party/WebKit/Source/platform/MemoryCoordinator.cpp

Project Member

Comment 22 by bugdroid1@chromium.org, Feb 8 2017

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

commit b95dbb50ccb02e2f5584419033d5409ae0e1d8f5
Author: tasak <tasak@google.com>
Date: Wed Feb 08 18:07:50 2017

time metric: record elapsed time from when the backgrounded and purged renderer is foregrounded until the renderer is painted.

Record the effect of purge-and-suspend experiment. Since the purge clears some
caches, we need to recover the caches when the renderer is painted,
i.e. whether the recovery takes short time or not.

BUG=635419

Review-Url: https://codereview.chromium.org/2643723007
Cr-Commit-Position: refs/heads/master@{#449038}

[modify] https://crrev.com/b95dbb50ccb02e2f5584419033d5409ae0e1d8f5/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/b95dbb50ccb02e2f5584419033d5409ae0e1d8f5/content/renderer/render_thread_impl.h
[modify] https://crrev.com/b95dbb50ccb02e2f5584419033d5409ae0e1d8f5/content/renderer/render_widget.cc
[modify] https://crrev.com/b95dbb50ccb02e2f5584419033d5409ae0e1d8f5/content/renderer/render_widget.h
[modify] https://crrev.com/b95dbb50ccb02e2f5584419033d5409ae0e1d8f5/tools/metrics/histograms/histograms.xml

Comment 23 by tasak@google.com, Feb 10 2017

Owner: tasak@google.com
Project Member

Comment 24 by bugdroid1@chromium.org, Feb 17 2017

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

commit 9c3ce4099b593b5172fe94028c949730f72716ef
Author: bashi <bashi@chromium.org>
Date: Fri Feb 17 04:26:50 2017

Make purge+throttled feature work with memory coordinator

Purge+throttled (previously called purge+suspend) used to depend on
MemoryCoordinatorClient::OnStateChange() and that's why we couldn't enable
purge+throttled and memory coordinator at the same time. As of
crrev.com/2695923003 all purging logic has moved to
MemoryCoordinatorClient::OnPurgeMemory(), which can be used by both
memory coordinator and purge+throttled feature. Both features don't have to be
mutually exclusive anymore.

BUG=635419

Review-Url: https://codereview.chromium.org/2701473005
Cr-Commit-Position: refs/heads/master@{#451207}

[modify] https://crrev.com/9c3ce4099b593b5172fe94028c949730f72716ef/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/9c3ce4099b593b5172fe94028c949730f72716ef/content/renderer/render_thread_impl.h

Project Member

Comment 28 by bugdroid1@chromium.org, May 15 2017

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

commit bb0640b700217f492e6d68bd2f3a31afea8c8c98
Author: tasak <tasak@google.com>
Date: Mon May 15 09:02:26 2017

Record renderer's memory growth 30min, 60min and 90min after purging separately.

We would like to compare 30 min's metrics with 60 and 90 min's data.

BUG=670539,635419

Review-Url: https://codereview.chromium.org/2843373004
Cr-Commit-Position: refs/heads/master@{#471706}

[modify] https://crrev.com/bb0640b700217f492e6d68bd2f3a31afea8c8c98/content/renderer/render_thread_impl.cc
[modify] https://crrev.com/bb0640b700217f492e6d68bd2f3a31afea8c8c98/content/renderer/render_thread_impl.h
[modify] https://crrev.com/bb0640b700217f492e6d68bd2f3a31afea8c8c98/tools/metrics/histograms/histograms.xml

Blockedon: 722792
Project Member

Comment 30 by bugdroid1@chromium.org, May 18 2017

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

commit 1870aebe1a769e4220a3ba1025bed28d19300c71
Author: hajimehoshi <hajimehoshi@chromium.org>
Date: Thu May 18 07:54:28 2017

Disable recoding purge-and-suspend memory growth temporarily

Recoding purge-and-suspend memory growth introduced at
crrev.com/2843373004 causes DCHECK errors. This CL removes them
temporarily.

BUG= 722792 , 670539, 635419

Review-Url: https://codereview.chromium.org/2893863002
Cr-Commit-Position: refs/heads/master@{#472729}

[modify] https://crrev.com/1870aebe1a769e4220a3ba1025bed28d19300c71/content/renderer/render_thread_impl.cc

Project Member

Comment 31 by bugdroid1@chromium.org, May 24 2017

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

commit a27961af152737aeb934c77180b9667e51bbee06
Author: tasak <tasak@google.com>
Date: Wed May 24 07:33:25 2017

Reenable Purge+Suspend Memory Growth metrics.

Fix DCHECK failure in base::HistogramBase::CheckName(). We need to use different
scope for each histogram name, because UMA_HISTOGRAM macro defines a static variable and checks whether the histogram name stored in the variable is the same as newly given histogram names or not.

BUG= 722792 , 670539, 635419

Review-Url: https://codereview.chromium.org/2899683002
Cr-Commit-Position: refs/heads/master@{#474197}

[modify] https://crrev.com/a27961af152737aeb934c77180b9667e51bbee06/content/renderer/render_thread_impl.cc

Project Member

Comment 32 by bugdroid1@chromium.org, May 30 2017

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

commit 0080e6314ded16654d2ed05c9cc0cc2b65bbb57b
Author: tasak <tasak@google.com>
Date: Tue May 30 20:06:34 2017

Fix histograms.xml for PurgeAndSuspend.Experimental.MemoryGrowth.

BUG=670539,635419

Review-Url: https://codereview.chromium.org/2910103002
Cr-Commit-Position: refs/heads/master@{#475640}

[modify] https://crrev.com/0080e6314ded16654d2ed05c9cc0cc2b65bbb57b/tools/metrics/histograms/histograms.xml

Project Member

Comment 33 by bugdroid1@chromium.org, Jun 6 2017

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

commit 3795db0c42337bd38bb0c070b7021c91906a72f2
Author: tasak <tasak@google.com>
Date: Tue Jun 06 21:33:34 2017

Remove obsolete from PurgeAndSuspend.Experimental.MemoryGrowth.* suffixes.

Since PurgeAndSuspend.Experimental.MemoryGrowth.* are obsoleted, PurgeAndSuspend.Experimental.MemoryGrowth.*.30min, 60min and 90min are also obsoleted.

BUG=670539,635419

Review-Url: https://codereview.chromium.org/2923073003
Cr-Commit-Position: refs/heads/master@{#477412}

[modify] https://crrev.com/3795db0c42337bd38bb0c070b7021c91906a72f2/tools/metrics/histograms/histograms.xml

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

Cc: -ojan@chromium.org
Owner: tasak@chromium.org

Sign in to add a comment