Closed
Bug 1475952
Opened 8 years ago
Closed 8 years ago
TelemetrySession.jsm:gatherMemory is janky
Categories
(Toolkit :: Telemetry, defect, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 1503973
| Performance Impact | ? |
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | affected |
People
(Reporter: florian, Unassigned)
References
(Depends on 1 open bug)
Details
Here is a profile I captured yesterday on a recent (July 6th) nightly on my Macbook after waking it from a week-end of sleep: https://perfht.ml/2L1iArM
gatherMemory causes 456ms of jank, when getting the residentUnique value.
Updated•8 years ago
|
OS: Unspecified → Mac OS X
Hardware: Unspecified → All
Updated•8 years ago
|
Priority: -- → P3
Comment 1•8 years ago
|
||
:gfritzsche, the amount of time spent is worrisome. How often does gatherMemory run (and potentially cause jank)?
Flags: needinfo?(gfritzsche)
Updated•8 years ago
|
Whiteboard: [qf] → [qf:investigate]
Comment 2•8 years ago
|
||
This seems familiar from bug 789975, which added the ResidentFast reporter with the following description:
+ "This reporter measures the same value as the resident memory reporter, but "
+ "it tries to be as fast as possible, at the expense of accuracy. On most "
+ "platforms this is identical to the vanilla resident reporter, but on MacOS"
+ "in particular, this reporter may over-count our RSS. You should use "
+ "resident-fast where you care about latency of collection (e.g. in "
+ "telemetry). Otherwise you should use the regular resident reporter.")
https://hg.mozilla.org/mozilla-central/rev/0348a30c19b4
Comment 3•8 years ago
|
||
(In reply to Markus Stange [:mstange] from comment #2)
> This seems familiar from bug 789975, which added the ResidentFast reporter
> with the following description:
>
> + "This reporter measures the same value as the resident memory reporter,
> but "
> + "it tries to be as fast as possible, at the expense of accuracy. On
> most "
> + "platforms this is identical to the vanilla resident reporter, but on
> MacOS"
> + "in particular, this reporter may over-count our RSS. You should use "
> + "resident-fast where you care about latency of collection (e.g. in "
> + "telemetry). Otherwise you should use the regular resident reporter.")
>
> https://hg.mozilla.org/mozilla-central/rev/0348a30c19b4
In this case it's the resident-unique reporter being slow on MacOS.
Comment 4•8 years ago
|
||
(In reply to Florian Quèze [:florian] from comment #0)
> Here is a profile I captured yesterday on a recent (July 6th) nightly on my
> Macbook after waking it from a week-end of sleep: https://perfht.ml/2L1iArM
>
> gatherMemory causes 456ms of jank, when getting the residentUnique value.
That URL doesn't seem to be valid.
(In reply to :Harald Kirschner :digitarald from comment #1)
> :gfritzsche, the amount of time spent is worrisome. How often does
> gatherMemory run (and potentially cause jank)?
Most of the gatherMemory code does not run on release. Was that report from a prerelease Firefox?
https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/toolkit/components/telemetry/TelemetrySession.jsm#985
Flags: needinfo?(gfritzsche) → needinfo?(florian)
Comment 5•8 years ago
|
||
The memory reporting code also happens to live inside a Telemetry module for historical reasons, but we don't have good context on this.
I'm still interested to find out which team is effectively owning these.
Comment 6•8 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #4)
> (In reply to Florian Quèze [:florian] from comment #0)
> > Here is a profile I captured yesterday on a recent (July 6th) nightly on my
> > Macbook after waking it from a week-end of sleep: https://perfht.ml/2L1iArM
> >
> > gatherMemory causes 456ms of jank, when getting the residentUnique value.
>
> That URL doesn't seem to be valid.
The URL works for me now, weird.
Comment 7•8 years ago
|
||
The memory information is gathered on:
- TOPIC_CYCLE_COLLECTOR_BEGIN, at most once per minute:
https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/toolkit/components/telemetry/TelemetrySession.jsm#1690
- 60 seconds after process startup
- when we send a "main" ping
On release Firefox, we only collect `ghostWindows`:
https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/toolkit/components/telemetry/TelemetrySession.jsm#983
On prerelease Firefox, we collect a bunch more memory values.
It would be good to know whether
- this is janky on release or only prerelease
- who uses these measurements
- and, if changes are needed, at which interval they actually need to be recorded at
| Reporter | ||
Comment 8•8 years ago
|
||
(In reply to Georg Fritzsche [:gfritzsche] from comment #4)
> Most of the gatherMemory code does not run on release. Was that report from
> a prerelease Firefox?
It was captured from a Nightly build.
(In reply to Georg Fritzsche [:gfritzsche] from comment #7)
> It would be good to know whether
> - who uses these measurements
Indeed, it would be good to know if the cost of collecting these measurements (even only on Nightly) is proportionate to the use we have of them.
Flags: needinfo?(florian)
Comment 9•8 years ago
|
||
It looks like nearly all of them have:
> "alert_emails": ["memshrink-telemetry-alerts@mozilla.com"]
So presumably the memshrink team is one important interested party.
Maybe Kris knows more?
Flags: needinfo?(kmaglione+bmo)
Comment 10•8 years ago
|
||
(In reply to Florian Quèze [:florian] from comment #8)
> > - who uses these measurements
>
> Indeed, it would be good to know if the cost of collecting these
> measurements (even only on Nightly) is proportionate to the use we have of
> them.
It definitely is. I'm not sure how much the resident unique reporter in particular contributes, but memory usage telemetry in general regularly catches major regressions.
That said, a half a second for that reporter seems pretty extreme. At the least, we should probably try to run these during idle slices.
(In reply to Georg Fritzsche [:gfritzsche] from comment #9)
> It looks like nearly all of them have:
> > "alert_emails": ["memshrink-telemetry-alerts@mozilla.com"]
>
> So presumably the memshrink team is one important interested party.
> Maybe Kris knows more?
Andrew is probably a better person to ask.
Flags: needinfo?(kmaglione+bmo) → needinfo?(continuation)
Comment 11•8 years ago
|
||
I use the ghost windows stuff, but I don't think I've ever looked at any of the other telemetry being gathered there, and I don't remember alert emails for any of it. I guess I have looked at MEMORY_JS_COMPARTMENTS_* a few times. I certainly haven't looked at MEMORY_UNIQUE. Eric, have you, or should we just stop gathering MEMORY_UNIQUE?
Flags: needinfo?(continuation) → needinfo?(erahm)
Comment 12•8 years ago
|
||
MEMORY_UNIQUE and MEMORY_TOTAL are going to pretty useful as we spin up more content processes.
Flags: needinfo?(erahm)
Comment 13•8 years ago
|
||
Lets dup this over to a more recent bug that points to the latest code.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Updated•4 years ago
|
Performance Impact: --- → ?
Whiteboard: [qf:investigate]
You need to log in
before you can comment on or make changes to this bug.
Description
•