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

Issue 751283 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug
Hotlist-MemoryInfra



Sign in to add a comment

Out of process heap profiler: Create a mechanism to identify specific connections.

Project Member Reported by erikc...@chromium.org, Aug 1 2017

Issue description

The current design assumes "pids" are the unique process/connection identifier, but those are not necessarily available within a sandboxed renderer.

Note: OOPHP is still in prototyping stage.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 10 2017

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

commit 59d85acb04020ec97ea5b63c8e15fdc77a459e45
Author: Albert J. Wong <ajwong@chromium.org>
Date: Thu Aug 10 00:50:57 2017

Rework communication model for out-of-process heap profiling.

Previously, the browser passed a "sender_id" to child processes during startup. The
child process would then create a pair of pipes, and send one pipe to the
profiling process, along with the "sender_id". This has several flaws:
  1) It exposes the profiling process to renderers.
  2) It requires the profiling process to trust the "sender_id" sent by the renderer.
  3) It requires the renderer to create a PlatformChannelPair, which it cannot
  do on Windows because of the sandbox.
  4) The "sender_id" eventually needs to be mapped back to an actual process.

In the new model:
  1) Child processes expose a MemlogClient interface.
  2) Each child process has an instance of a MemlogClient that listens for a
  "StartProfiling" request from the browser process. On receiving the request,
  it begins profiling and sends the data into the handle passed from
  StartProfiling.
  3) The browser process observes creations of all child processes. When a new
  process is created, the browser process creates a PlatformChannelPair. It passes one
  pipe to the child via MemlogClient::StartProfiling, and the other to the
  profiling process via Memlog::AddSender.
  4) The browser process also passes the pid of the process to the profiling
  process. This allows the chrome://memory-internals UI to trigger a dump of the
  appropriate process.

Minor changes include:
  * Many lifetime semantic improvements. In all child processes, a single
  MemlogClient [owned by ChromeContentClient] is responsible for owning all
  profiling-relevant objects.
  * In the browser process, the MemlogClient in ChromeContentClient does
  nothing. Instead, ChromeBrowserMainExtraPartsProfiling creates the singleton
  ProfilingProcessHost, which in turn owns a MemlogClient, which is responsible
  for all profiling in the process. Yes, this is a second instance of
  MemlogClient in the browser process.
  * Removed all code from chrome/common/profiling/memlog_sender.h, which
  included some duplicate code for connecting to the profiling process, starting
  profiling in the current process, and a wacky global.
  * Previously, the "--memlog" switch was not respected. Any binary compiled
  with enable_oop_heap_profiling would start the profiler. Now, the browser
  process only creates the ProfilingProcessHost if the "--memlog" switch has
  been set.

Bug:  751302 ,  751283 
Change-Id: I84c570631ef999f76d3145fe1a9d4387f4d3147d
Reviewed-on: https://chromium-review.googlesource.com/602526
Commit-Queue: Albert J. Wong <ajwong@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Reviewed-by: Brett Wilson <brettw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493198}
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/chrome_content_browser_client.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/chrome_content_gpu_manifest_overlay.json
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/chrome_content_renderer_manifest_overlay.json
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/chrome_content_utility_manifest_overlay.json
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/profiling_host/BUILD.gn
[add] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.cc
[add] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/profiling_host/chrome_browser_main_extra_parts_profiling.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/profiling_host/profiling_process_host.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/profiling_host/profiling_process_host.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/chrome_content_client.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/chrome_content_client.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/chrome_switches.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/chrome_switches.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/profiling/BUILD.gn
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/profiling/memlog.mojom
[add] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/profiling/memlog_client.cc
[add] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/profiling/memlog_client.h
[add] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/common/profiling/memlog_client.mojom
[delete] https://crrev.com/c81633b02745de3295e97836086dbb7bc3e2f22c/chrome/common/profiling/memlog_sender.cc
[delete] https://crrev.com/c81633b02745de3295e97836086dbb7bc3e2f22c/chrome/common/profiling/memlog_sender.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/profiling/memlog_connection_manager.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/profiling/memlog_connection_manager.h
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/profiling/memlog_impl.cc
[modify] https://crrev.com/59d85acb04020ec97ea5b63c8e15fdc77a459e45/chrome/profiling/memlog_impl.h

Owner: ajwong@chromium.org
Status: Fixed (was: Untriaged)

Sign in to add a comment