Closed Bug 1597562 Opened 6 years ago Closed 5 years ago

Better support for Fission content processes in about:memory

Categories

(Toolkit :: about:memory, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla80
Fission Milestone M6c
Tracking Status
firefox80 --- fixed

People

(Reporter: mccr8, Assigned: Yoric)

References

Details

Attachments

(1 file, 1 obsolete file)

kmag suggested the support for Fission could be improved in about:memory. Specifically, we could indicate more specific than "Web Content" for Fission processes. It sounded like maybe he was thinking of putting the URL in there? (Which would need to be anonymized if that was enabled.) I'm not sure how well that will work with the index, given how there's not much room.

Tentatively assigning to the M5 dogfooding milestone because this about:memory information would be helpful for dogfood testers.

Fission Milestone: --- → M5

Blocks Fission dogfooding (M5).

Priority: -- → P3

Moving to Fission Nightly (M6)

TBD: How might we redesign about:memory to scale to many iframe processes?

Fission Milestone: M5 → M6

Yoric, perhaps you can work on this bug to improve about:memory for Fission after about:processes?

This bug is a Fission Nightly blocker (milestone M6c).

Fission Milestone: M6 → M6c
Flags: needinfo?(dteller)

Works for me.

mccr8, why do we need to anonymize?

Assignee: nobody → dteller
Flags: needinfo?(dteller) → needinfo?(continuation)

Memory reports get included in crash reports.

Flags: needinfo?(continuation)

(In reply to Andrew McCreight [:mccr8] from comment #6)

Memory reports get included in crash reports.

But we can patch just the output of about:memory without patching the memory reports, right? Or are there some hardcoded shenanigans involved?

kmag, to clarify, is the objective to expand the data made available in the actual about:memory page or in the memory crash reports?

Flags: needinfo?(continuation)
Flags: needinfo?(kmaglione+bmo)

(In reply to David Teller [:Yoric] (please use "needinfo") from comment #7)

But we can patch just the output of about:memory without patching the memory reports, right? Or are there some hardcoded shenanigans involved?

Anonymity is a property of an individual memory report. You have to check the aAnonymize flag when generating the report. Here's an example.

Flags: needinfo?(continuation)

(In reply to Andrew McCreight [:mccr8] from comment #8)

(In reply to David Teller [:Yoric] (please use "needinfo") from comment #7)

But we can patch just the output of about:memory without patching the memory reports, right? Or are there some hardcoded shenanigans involved?

Anonymity is a property of an individual memory report. You have to check the aAnonymize flag when generating the report. Here's an example.

So you suggest I patch CollectReports rather than patching about:memory itself, right?

Flags: needinfo?(continuation)

(In reply to David Teller [:Yoric] (please use "needinfo") from comment #9)

So you suggest I patch CollectReports rather than patching about:memory itself, right?

I'm not sure what you mean. This extra information should be added to the memory reports. about:memory itself just loads a memory report. I don't think it adds extra information.

Flags: needinfo?(continuation)

Well, that's my entire question :) It should be fairly easy to patch about:memory (the page) to add data only in the UX. If this data is never meant to be added to other kinds of memory reports, it might (or might not) be simpler/better.

Pushed by dteller@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4311c3df8803 about:memory now displays process types;r=mccr8
Backout by malexandru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/010cfd3c3b56 Backed out changeset 4311c3df8803 for causing failures in aboutmemory.
Flags: needinfo?(dteller)

Andrew, my code seems to add one instance of vsize, heap-allocated, resident... which cause all the tests to fail. Do you have an idea what could be going on?

Flags: needinfo?(kmaglione+bmo) → needinfo?(continuation)

I don't know anything about these tests. Maybe they are doing some kind of canonicalization that combines together reports from the same process type, and your patch is breaking that?

njn might have some guesses.

Flags: needinfo?(continuation) → needinfo?(n.nethercote)

Several of the tests collate all the vsize/resident/whatever measurements and check if there are the expected number, which corresponds to the number of processes. If you have changed the number of processes that are alive, or you have somehow broken memory reporting of those measurements for some processes, then you will see failures along those lines.

Having said all that, I see failures like "typeError: can't access property "length", endOfBrowsers is null" which suggests something a bit deeper is going on. I don't know why the very simple patch could cause any of the above, though.

Flags: needinfo?(n.nethercote)

What do you mean collate? Could it somehow end merging two reports from processes that have the same name (minus pid)? So far, it's the only hypothesis that seems to make sense.

Having said all that, I see failures like "typeError: can't access property "length", endOfBrowsers is null" which suggests something a bit deeper is going on. I don't know why the very simple patch could cause any of the above, though.

Apparently, there's code in the tests that turns one-element arrays into their first/single value. I'm fairly sure that this is what causes the error messages because we end up with two items instead of one.

Flags: needinfo?(n.nethercote)

Ok, about:memory does seem to merge information from processes that have the exact same name.

https://searchfox.org/mozilla-central/rev/7cadba1d8b8feaec4615f5bb98aac4b8a719793c/toolkit/components/aboutmemory/content/aboutMemory.js#1186

Is this a behavior I need to preserve? If so, I'll need to rework my patch a bit.

Flags: needinfo?(continuation)

(In reply to David Teller [:Yoric] (please use "needinfo") from comment #20)

Is this a behavior I need to preserve? If so, I'll need to rework my patch a bit.

about:memory includes the pid in the process name right now, so it isn't actually combining anything. I'm guessing the merging only happens in some kind of testing mode? Presumably it is doing something in testing mode that excludes the pid, so presumably when you exclude the pid you could also exclude the URL from the process name.

Flags: needinfo?(continuation)

There is code in some of the tests to filter out the PIDs, e.g. here.

Flags: needinfo?(n.nethercote)

The changes in ContentChild.cpp seem to accidentally undo some of the changes that required Bug 1634987. This patch attempts to update the tests to the new reality.

Things are odd. Several about:memory tests fail on my machine from mozilla-central.

Maybe it's because I'm on macOS Catalina?

Attachment #9152861 - Attachment is obsolete: true
Attachment #9152861 - Attachment description: Bug 1597562 - about:memory now displays process types;r?mccr8! → Bug 1597562 - about:memory now displays process types;r?njn
Attachment #9152861 - Attachment is obsolete: false
Attachment #9154924 - Attachment is obsolete: true
Pushed by dteller@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09ce524559da about:memory now displays process types;r=mccr8

That's... interesting.

jmaher, do you know how I can launch that test?

Flags: needinfo?(dteller) → needinfo?(jmaher)

I assume ./mach awsy-test --help will point you in the right direction

Flags: needinfo?(jmaher)

Thanks.
Well, as expected, the tests fail on my machine even pre-patch. I'll wait until I have received my Linux desktop to resume work on this bug.

David, for this test you can run the follow for a quick sanity check: ./mach awsy-test --per-tab-pause 1 --settle-wait-time 1 testing/awsy/awsy/test_base_memory_usage.py

The failure points to process_perf_data:

[task 2020-06-11T11:16:48.593Z] 11:16:48     INFO - TEST-UNEXPECTED-ERROR | awsy/test_base_memory_usage.py TestMemoryUsage.test_open_tabs | IndexError: list index out of range
...
[task 2020-06-11T11:16:48.594Z] 11:16:48     INFO -   File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/awsy/process_perf_data.py", line 52, in median
[task 2020-06-11T11:16:48.594Z] 11:16:48     INFO -     return (sorted_[med - 1] + sorted_[med]) / 2

My guess is the list of values is empty leading ot an out of bounds acesss. We limit this value to only process that have the name Web Content. Did you change the name to not contain that string?

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:Yoric, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(dteller)
Flags: needinfo?(dteller)

(In reply to Eric Rahm [:erahm] from comment #32)

My guess is the list of values is empty leading ot an out of bounds acesss. We limit this value to only process that have the name Web Content. Did you change the name to not contain that string?

Yes, under Fission, we're using a more detailed list of types. So, under Fission, Web Content => web, but without Fission, it remains Web Content. Trying to find out where we're using that string.

Pushed by dteller@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d2e5708bb9cf about:memory now displays process types;r=mccr8,perftest-reviewers,sparky
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: