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

Issue 684839 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit 15 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Hotlist-MemoryInfra



Sign in to add a comment

Add enable_heap_profiling to chrome://flags

Project Member Reported by dskiba@chromium.org, Jan 24 2017

Issue description

On both Android and ChromeOS it's sometimes impossible (e.g. on non-rooted device) to enable heap profiling via command line flags.

To workaround that we need to be able to enable heap profiling from chrome://flags.
 
So if we do this, I think this should be a tri-state element:
1. disabled (default)
2. enabled (but requires manual tracing to get the snapshots)
3. enabled + auto-uploads: this will automatically grab snapshots and upload them somewhere.

Or maybe 3 should be the combination of  2 + having enabled deep reports ("navigation tracing")
Owner: dskiba@chromium.org
Status: Assigned (was: Untriaged)
From duplicate 689639 (by erikchen@):

"
Let's add a flag to about://flags that enables heap profiling [in the future, we can consider how to get native heap profiling, ajwong has some interesting ideas]. The flag should also allow us to collect dumps from the users, let's say at most by giving them a single button to press [trace on tap], or perhaps automatically uploaded [there may be privacy issues?] 

Then we can ask some people who we know have memory issues to turn on this flag, and we can start getting some live reports. 

cc-ing some people who are interested in this general sort of thing, and may have slightly different ideas on how we should do this.
"
Components: Internals>Instrumentation>Memory
Cc: dskiba@chromium.org ajwong@chromium.org
 Issue 689639  has been merged into this issue.
I think the idea for now is to upload these reports as "deep reports". I don't know if there is "deep reports" dashboard though.
Cc: erikc...@chromium.org oysteine@chromium.org
There is no pipeline for extracting memory data from deep reports. I believe they just get stored (in crash?), but we don't run any jobs on them to parse out the numbers from the traces.
Hmm, I wonder if the third option should be "enable slow reports". I.e. instead of heap profiling we would enable slow reports triggered by memory peaks.

The difference with "normal" slow reports is that this will be opt-in, and could be enabled on any build (even release one).
Re #9: NACK. that won't help with "malloc size is growing and we don't know why" which seems to happen more and more frequently. 
If we don't sort 3 out is not the end of the world, we can ask people to press a button in the meantime.
Check navigation_tracing.cc for the background tracing config which gets enabled for Deep Reports (i.e. the about://flags opt-in full-detail variant of Slow Reports). There's already a V8.GCLowMemoryNotification trigger present there, which can be modified or added to if we want to get reports from the existing Deep Reports population, or the same kind of background tracing setup could be used for a separate opt-in flag.

Other than the mechanism for enabling these reports, the rest of the pipeline is identical to the one ssid@ already made a memory-infra dashboard for, so the parsing/dashboard part should be easy enough.

That's all assuming you want automatic reporting and not a "submit trace plx" button, of course.

Comment 12 by ssid@chromium.org, Feb 14 2017

Re 10: If press a button and upload is the solution here then we do not need deep reports pipeline and processing. There will be very limited number of traces and can be looked at manually by the "memory sheriff" that we will have?

If we are doing auto upload then we can use deep reports. Yes, if we have large number of traces we can process them with the same pipeline. Currently I select only slow reports traces in processing for the dashboard. I can include option for deep reports traces if needed.
> Re 10: If press a button and upload is the solution here then we do not need deep reports pipeline and processing. There will be very limited number of traces and can be looked at manually by the "memory sheriff" that we will have?
Yup, for that I think that is a viable strategy and will fall into the Performance=Memory bug triaging process.

Auto-upload: let's discuss this in the "heap-profiling from the field document" as this has a broader scope and is off-topic for this bug.
This bug is about the fact that on some platforms the cmdline is not easily tweakable.
My fault having mis-driven the discussion when I wrote "3. enabled + auto-uploads". Forget about that point in this bug.
Let's use this to track the work for chrome://flags


No, it's not your fault, primiano@ :)

I think we initially treated both problems (enabling heap profiling / collecting results) as one.

And it makes sense to have just place to toggle all this.

And I also merged 689639 here, which was explicitly named "Turn on heap profiling in about://flags and enable collection of reports from users".

I agree that we should start by simply adding enabling-heap-profiling, but the issue doesn't stop there.
Cc: -rsch...@chromium.org
Status: Fixed (was: Assigned)

Sign in to add a comment