Closed Bug 1503973 Opened 6 years ago Closed 5 years ago

MemoryTelemetry.jsm janks the browser

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Performance Impact low

People

(Reporter: ehsan.akhgari, Assigned: kmag)

References

Details

(Keywords: perf, perf:responsiveness)

See this profile: https://perfht.ml/2QaHfst

The culprit is GetProcSelfSmapsPrivate at https://searchfox.org/mozilla-central/rev/39cb1e96cf97713c444c5a0404d4f84627aee85d/xpcom/base/nsMemoryReporterManager.cpp#90.

Pretty sure I've filed this before too but I can't find the bug any more...
Whiteboard: [qf]
Keywords: perf
See Also: → 1475952
The profile shows a 76ms event processing delay in the chrome process's main thread.

Looks like kmag touched this function in bug 1475899, though I'm not sure if that caused this or not.  kmag: do you have any thoughts on how this could be made better, and do you know if it might've been introduced by that bug or another recent change? e.g. is it possible for us to collect this data off-main thread somehow?
Flags: needinfo?(kmaglione+bmo)
Whiteboard: [qf] → [qf:p3:responsiveness]
The majority of the overhead here is just reading /proc/self/smaps, which there isn't really anything we can do about, aside from moving it to a background thread.
Flags: needinfo?(kmaglione+bmo)
(In reply to Daniel Holbert [:dholbert] from comment #1)
> The profile shows a 76ms event processing delay in the chrome process's main
> thread.

FWIW the reason why I filed the bug was repeated janks of this nature.  It can take various amounts of time of course.  Don't pay a lot of attention to the 76ms part specifically.
:kmag, what would be the appropriate component for memory reporting work?

More broadly: we'd be happy to have the collection code move out of toolkit/components/telemetry (it's only there for historical reasons), and we can help consult on any data collection questions you might have.
Flags: needinfo?(kmaglione+bmo)
(In reply to Chris H-C :chutten from comment #4)
> :kmag, what would be the appropriate component for memory reporting work?

Probably Core :: XPCOM or Toolkit :: about:memory
Flags: needinfo?(kmaglione+bmo)
Component: Telemetry → about:memory
Depends on: 1505522
Component: about:memory → XPCOM
Product: Toolkit → Core
Summary: MemoryTelemetry.jsm janks the browser on linux → MemoryTelemetry.jsm janks the browser
I've seen this now several times happening during page load.
Adding [qf] so that we can re-triage this and possibly move to [qf:p1:pageload] 

http://bit.ly/2RonqP9
Whiteboard: [qf:p3:responsiveness] → [qf:p3:responsiveness][qf]
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Assignee: nobody → kmaglione+bmo
Performance Impact: --- → P3
Whiteboard: [qf:p3:responsiveness][qf]
You need to log in before you can comment on or make changes to this bug.