New issue
Advanced search Search tips

Issue 878431 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Run heap profiler in utility process

Project Member Reported by jam@chromium.org, Aug 28

Issue description

As code migrates to mojo services, it would be good to get leaks from the wild for utility processes.
 
Owner: erikc...@chromium.org
Status: Assigned (was: Unconfirmed)
Project Member

Comment 2 by bugdroid1@chromium.org, Aug 30

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

commit 21e06c688bca3bdcb00b3ec9549989bb0d72c297
Author: erikchen <erikchen@chromium.org>
Date: Thu Aug 30 19:24:43 2018

Add heap profiling support for utility processes.

This CL adds two new heap profiling modes: "utility-sampling" and
"utility-and-browser". The former mode will profile all utility processes at
startup, with 1/3 probability. The latter will profile all utility processes and
the browser process [currently just useful for tests].

In addition to some small plumbing and tests, this CL modifies
UtilityThreadImpl::Init to call
"GetContentClient()->OnServiceManagerConnected(connection);". The callback
OnServiceManagerConnected() was not getting propagated to the
ChromeContentClient in the utility process [this was a bug].

The profiling process itself is a utility process and must never be profiled --
that will cause deadlock. This is avoided by adding an early out to
Client::StartProfiling for the utility process. The newly added tests confirm
that we don't deadlock even when attempting to profile all utility processes.

Change-Id: I74e2921d7ceff6150080c182db756be9ac0d076b
Bug:  878431 
Reviewed-on: https://chromium-review.googlesource.com/1195836
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587699}
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/chrome/android/javatests/src/org/chromium/chrome/browser/profiling_host/ProfilingProcessHostAndroidTest.java
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/chrome/browser/profiling_host/memlog_browsertest.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/chrome/browser/ui/webui/memory_internals_ui.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/heap_profiling/client_connection_manager.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/heap_profiling/test_driver.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/DEPS
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/BUILD.gn
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/client.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/settings.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/settings.h
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/switches.cc
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/components/services/heap_profiling/public/cpp/switches.h
[modify] https://crrev.com/21e06c688bca3bdcb00b3ec9549989bb0d72c297/content/utility/utility_thread_impl.cc

Cc: jam@chromium.org etienneb@chromium.org
We have the ability to turn on this experiment anytime we want for utility processes, on any platforms.
Status: Fixed (was: Assigned)
We've been running heap profiling in the utility process.
Project Member

Comment 6 by bugdroid1@chromium.org, Oct 25

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

commit 5d841ddad587ec2a53c369fbf9ec9947ea2c2721
Author: erikchen <erikchen@chromium.org>
Date: Thu Oct 25 20:05:37 2018

Add a utility process threshold for memlog uploads.

Without the threshold, memlog reports will never be uploaded for profiled
utility processes.

Bug:  878431 
Change-Id: I63fba01d45c2427859c5227d527bae8d6791e0e0
Reviewed-on: https://chromium-review.googlesource.com/c/1299656
Commit-Queue: Erik Chen <erikchen@chromium.org>
Reviewed-by: ssid <ssid@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602835}
[modify] https://crrev.com/5d841ddad587ec2a53c369fbf9ec9947ea2c2721/chrome/browser/profiling_host/background_profiling_triggers.cc

Owner: alph@chromium.org
Status: Assigned (was: Fixed)
Also we're enabling it for a single renderer process for 1% of Canary population. I need to keep this bug open for Finch experiment review.
Owner: erikc...@chromium.org
Status: Fixed (was: Assigned)

Sign in to add a comment