Open Bug 710499 Opened 13 years ago Updated 1 year ago

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

Categories

(Core :: Cycle Collector, defect)

defect

Tracking

()

People

(Reporter: mccr8, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch WIP, on top of bug 728460 (obsolete) — Splinter Review
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.
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.
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
Attachment #601355 - Attachment is obsolete: true
This needs some cleanup.  I should also probably use reason 0 for the various "manual" triggers for the CC, just out of completeness.
See Also: → 1732161
Severity: normal → S3
Component: XPCOM → Cycle Collector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: