Open Bug 1119255 Opened 9 years ago Updated 2 years ago

Report the compartments that use most memory through Telemetry

Categories

(Firefox :: General, defect)

36 Branch
x86
macOS
defect

Tracking

()

People

(Reporter: Yoric, Unassigned)

References

Details

To investigate both the add-ons and the pages that cause insane memory use, we need to report the compartments that use most memory through Telemetry.
In practice, I believe that we want to record the peak memory usage for:
- each jsm;
- each origin (if we have several tabs on the same origin, keep the max of the tabs, not the sum).

Then, during profile-before-change, collect the data and send it to Telemetry.

Does this make sense, Vladan?
Flags: needinfo?(vdjeric)
At a higher level, I think these are the kinds of questions we want to answer with per-compartment memory & CPU usage reporting:

1) Which extensions are causing high memory or CPU usage?
2) Which tabs are using a lot of CPU or memory? We can't submit URLs to Telemetry but we can inform users of what's causing their performance problems (e.g. in Firefox Self-Support)
3) Are any background Firefox threads causing high CPU usage when they shouldn't? there was a real regression like this recently in the Necko code
4) Are any Firefox features causing unexpectedly high memory usage? This should catch the regressions on the less-frequently used code paths that Talos & areweslimyet.com can't
5) How does e10s affect memory/CPU usage? D extensions use a lot more CPU because they're doing IPC, do particular Firefox features use more memory, etc

To answer your questions directly:

- I think we want to aggregate the per-compartment memory usage in meaningful ways. So ideally we'd report per-tab, per-extension, and per-feature memory usage. We could break it down further, but it's those higher-level memory measurements that we're really after. The more detailed per-JSM, per-origin stuff is useful for debugging but we already have about:memory for that.What do you think?
- Telemetry should be able to provide the memory usage stats whenever needed, whether it be when saving pings during profile-before-change, in idle-daily pings, or when opening about:telemetry.
- I think it makes sense to collect peak and average memory usage for each "thing" we measure. We can do fancier stuff after we get the basics, for example we could report on spikes or monotonic increases in an extension's memory usage.
Flags: needinfo?(vdjeric)
I meant peak usage per-jsm and per-origin, because I assume it's easier to collect during run-time. Then post-process it during shutdown for Telemetry.

Now, I'm not sure how I can determine peak usage per-jsm/per-origin. Nick, is there something in the memoy reporters that can help me get data on peak memory usage?
Flags: needinfo?(n.nethercote)
> Nick, is there something in the memoy reporters that can help me get data on peak
> memory usage?

No. They're all about instantaneous measurements. Peak measurements are hard. Bug 842800 is related to this but it never went anywhere.
Flags: needinfo?(n.nethercote)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.