[CC] add telemetry for the reason why the CC was triggered

RESOLVED INACTIVE

Status

()

Core
XPCOM
RESOLVED INACTIVE
7 years ago
18 hours ago

People

(Reporter: mccr8, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

7 years ago
There are only two reasons (lots of things in the purple buffer, we did a GC recently) but it would be nice to see exactly what was the trigger for a particular CC.
(Reporter)

Comment 1

6 years ago
Created attachment 601355 [details] [diff] [review]
WIP, on top of bug 728460

This patch adds telemetry for some of the reasons the cycle collector is invoked.  This only covers the three "automatic" reasons it is invoked, not the various places it can be manually invoked.  These three reasons are: we recently did a full GC, we have too many things in the purple buffer, it has been too long since we last did a CC.

Because it is common for more than one of these reasons to apply at once, I convert the vector of 3 booleans into a value from 1 to 7.

In my testing with bug 728460, about 70 to 80% of the time the only reason is that we recently had a full GC.  About 7% of the time, the only reason is the purple buffer has too many things in it.  About 20% of the time, both of these conditions apply.  I also saw an instance where the purple buffer was too big and the timer fired.  This is with the current max purple buffer size and timer.  I think the timer should be kicked down to 2 minutes, at least.
(Reporter)

Comment 2

6 years ago
When I change the purple buffer threshold to 200 and set the last ditch timer to 2 minutes, then about 25% of CCs are due to force-GCs, 25% are due to purple buffer, and the rest are due to both.  The average time between CCs is 17 seconds.
(Reporter)

Updated

6 years ago
Summary: [CC] log the reason why the CC was triggered to the error console → [CC] add telemetry for the reason why the CC was triggered
(Reporter)

Comment 3

6 years ago
Created attachment 602545 [details] [diff] [review]
rebased, still a little rough
Attachment #601355 - Attachment is obsolete: true
(Reporter)

Comment 4

6 years ago
This needs some cleanup.  I should also probably use reason 0 for the various "manual" triggers for the CC, just out of completeness.

Comment 5

18 hours ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 18 hours ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.