Implement a v8::Isolate::NearHeapLimitCallback and dispatch a "bloated page" message to the browser process.
Removing "Blink" from the components list.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fc84822a48a47a20858c43f794b408a156df97d1 commit fc84822a48a47a20858c43f794b408a156df97d1 Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon May 14 12:58:57 2018 Initial handling of bloated V8 heaps near the heap limit. This patch adds a new Blink feature flag - BloatedRendererDetection. When the flag is enabled, Blink uses the new V8 API to install a callback that is invoked when V8's heap reaches the heap limit. The callback notifies the BloatedRendererDetector controller that in future will dispatch a message to the browser process for reloading the tab and showing an infobar explaining that the tab ran out of memory. The patch also adds a new UMA histograms - "BloatedRenderer.V8.NearV8HeapLimitHandling" Bug: 835806 Change-Id: I2f1bcefaaf8a553517de9a1bb2dc9d084f4eca4b Reviewed-on: https://chromium-review.googlesource.com/1024033 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Mark Pearson <mpearson@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Cr-Commit-Position: refs/heads/master@{#558275} [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/bindings/core/v8/v8_initializer.h [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/controller/BUILD.gn [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/controller/blink_initializer.cc [add] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/controller/bloated_renderer_detector.cc [add] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/controller/bloated_renderer_detector.h [add] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/controller/bloated_renderer_detector_test.cc [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.cc [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/third_party/blink/renderer/platform/runtime_enabled_features.json5 [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/tools/metrics/histograms/enums.xml [modify] https://crrev.com/fc84822a48a47a20858c43f794b408a156df97d1/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e7d18c79fef2898cdc31d922b76097b27e078400 commit e7d18c79fef2898cdc31d922b76097b27e078400 Author: Ulan Degenbaev <ulan@chromium.org> Date: Fri Jun 08 17:52:11 2018 Notify the browser process about a bloated renderer via the GRC. The renderer sends a RendererIsBloated event to the GRC service. The GRC turns the event into a PageIsBloated signal and sends the signal to the tab manager in the browser process. The tab manager then reloads the bloated tab. Subsequent CL will add a notification from the tab manager to the web contents, so that it can show an inforbar after the reload. Bug: 835806 Change-Id: I23d0987094f1c6864534abeb57f8cce3273172ff Reviewed-on: https://chromium-review.googlesource.com/1073419 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Will Harris <wfh@chromium.org> Reviewed-by: Steven Holte <holte@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Chris Hamilton <chrisha@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#565680} [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/page_signal_receiver.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/page_signal_receiver.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_lifecycle_unit.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/chrome/browser/resource_coordinator/tab_manager_browsertest.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/content/public/test/web_contents_tester.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/content/test/test_web_contents.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/content/test/test_web_contents.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/coordination_unit/process_coordination_unit_impl.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/observers/page_signal_generator_impl.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/observers/page_signal_generator_impl.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/observers/page_signal_generator_impl_unittest.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/public/mojom/coordination_unit.mojom [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/public/mojom/page_signal.mojom [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/services/resource_coordinator/public/mojom/signals.mojom [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/third_party/blink/renderer/controller/bloated_renderer_detector.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/third_party/blink/renderer/platform/instrumentation/resource_coordinator/renderer_resource_coordinator.cc [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/third_party/blink/renderer/platform/instrumentation/resource_coordinator/renderer_resource_coordinator.h [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/tools/metrics/histograms/enums.xml [modify] https://crrev.com/e7d18c79fef2898cdc31d922b76097b27e078400/tools/metrics/histograms/histograms.xml
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/cc84fa4c7ae52dd72660f20130a753af9b401427 commit cc84fa4c7ae52dd72660f20130a753af9b401427 Author: Ulan Degenbaev <ulan@chromium.org> Date: Wed Jun 20 17:29:28 2018 Introduce a flag for skipping uptime check for bloated renderers. This adds BloatedRendererDetectionSkipUptimeCheck runtime-feature flag. Bug: 835806 Change-Id: Ifd8392f24f3c5044096e017eedd38fb8db53046b Reviewed-on: https://chromium-review.googlesource.com/1107806 Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#568899} [modify] https://crrev.com/cc84fa4c7ae52dd72660f20130a753af9b401427/third_party/blink/renderer/controller/bloated_renderer_detector.cc [modify] https://crrev.com/cc84fa4c7ae52dd72660f20130a753af9b401427/third_party/blink/renderer/platform/runtime_enabled_features.json5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/16a3bc07fa041a5d17add80edcd10d226eb6a26e commit 16a3bc07fa041a5d17add80edcd10d226eb6a26e Author: Ulan Degenbaev <ulan@chromium.org> Date: Fri Jun 22 13:00:54 2018 Move bloated renderer reloading logic to BloatedRendererTabHelper. Currently resource_coordinator::TabLifecycleUnit controls reloading of a bloated renderer process and notifies the tab helper. This CL moves the renderer process reloading to the tab helper, so that all code related to bloated rendere is in one place. Bug: 835806 ,808143 Change-Id: I1577872a1adc043a87bb2f599b211d3be9708f5c Reviewed-on: https://chromium-review.googlesource.com/1097481 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#569588} [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_lifecycle_unit.h [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/resource_coordinator/tab_manager_browsertest.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/ui/bloated_renderer/bloated_renderer_tab_helper.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/ui/bloated_renderer/bloated_renderer_tab_helper.h [add] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/ui/bloated_renderer/bloated_renderer_tab_helper_browsertest.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/browser/ui/bloated_renderer/bloated_renderer_tab_helper_unittest.cc [modify] https://crrev.com/16a3bc07fa041a5d17add80edcd10d226eb6a26e/chrome/test/BUILD.gn
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ffed3d45f18293a4d207dc7890d1765053d26e79 commit ffed3d45f18293a4d207dc7890d1765053d26e79 Author: Ulan Degenbaev <ulan@chromium.org> Date: Mon Jul 02 12:09:41 2018 Record UKM metrics related to bloated renderer handling. This adds the following metrics: - BloatedRenderer.V8.Heap, - BloatedRenderer.V8.Heap.AllocatedObjects, - BloatedRenderer.V8.Heap.Limit, - BloatedRenderer.V8.NearV8HeapLimitHandling. The metrics are recorded on the main thread when there is only one page running in the bloated renderer process. See "Privacy Considerations" section in go/proompt for privacy review. Bug: 835806 Change-Id: I717c98935fdcd3cc1bfe8cbb9710fa671400165e Reviewed-on: https://chromium-review.googlesource.com/1106142 Reviewed-by: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#571867} [modify] https://crrev.com/ffed3d45f18293a4d207dc7890d1765053d26e79/third_party/blink/renderer/bindings/core/DEPS [modify] https://crrev.com/ffed3d45f18293a4d207dc7890d1765053d26e79/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc [modify] https://crrev.com/ffed3d45f18293a4d207dc7890d1765053d26e79/tools/metrics/ukm/ukm.xml
Comment 1 by u...@chromium.org
, Apr 23 2018