Closed Bug 672694 Opened 9 years ago Closed 9 years ago

Add memory reporters to count compartments

Categories

(Core :: XPConnect, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: njn, Assigned: njn)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file, 1 obsolete file)

I often count the number of compartments manually.  It'd be nice (and easy) to automate this.
Good idea, I'll do that.
Attached patch patch (obsolete) — Splinter Review
This patch adds the js-compartment-count reporter.

It doesn't telemeterize the counter, however.  TelemetryPing.js has code that assumes that any UNITS_COUNT reporter reports a number that always increases, and so reports the change between pings.  This makes sense for the page-fault counters, but not for js-compartment-count.  I'll defer that to a follow-up bug (and assign it to jlebar, who implemented the current behaviour.)  We might need to distinguish between UNITS_COUNT and UNITS_COUNT_INCREASING.
Attachment #546989 - Flags: review?(gal)
Attachment #546989 - Flags: review?(gal) → review+
Blocks: 672731
Summary: Add a memory reporter for the number of compartments → Add a js-compartment-count memory reporter
Summary: Add a js-compartment-count memory reporter → Add memory reporters to count compartments
Attached patch patch, v2Splinter Review
I split this into two reporters:  js-system-compartment-count and js-user-compartment-count, because knowing the split is useful, and summing them to get the overall count is trivial.
Attachment #546989 - Attachment is obsolete: true
Attachment #547321 - Flags: review?(gal)
Attachment #547321 - Flags: review?(gal) → review+
http://hg.mozilla.org/integration/mozilla-inbound/rev/9bb30262e230
Whiteboard: [MemShrink] → [MemShrink][inbound]
http://hg.mozilla.org/mozilla-central/rev/9bb30262e230
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [MemShrink][inbound] → [MemShrink]
Target Milestone: --- → mozilla8
The user vs system terminology (I realize it comes from the names in the code) is confusing.

Do I understand correctly that the 'system' compartment basically counts compartments for the chrome code (as in "System principal")?
(In reply to comment #7)
> 
> Do I understand correctly that the 'system' compartment basically counts
> compartments for the chrome code (as in "System principal")?

That's right.  It also includes the 'atoms' compartment.
You need to log in before you can comment on or make changes to this bug.