Add memory reporters to count compartments

RESOLVED FIXED in mozilla8

Status

()

Core
XPConnect
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

6 years ago
I often count the number of compartments manually.  It'd be nice (and easy) to automate this.
Should we telemeterize this?
(Assignee)

Comment 2

6 years ago
Good idea, I'll do that.
(Assignee)

Comment 3

6 years ago
Created attachment 546989 [details] [diff] [review]
patch

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)

Updated

6 years ago
Attachment #546989 - Flags: review?(gal) → review+
(Assignee)

Updated

6 years ago
Blocks: 672731
(Assignee)

Updated

6 years ago
Summary: Add a memory reporter for the number of compartments → Add a js-compartment-count memory reporter
(Assignee)

Updated

6 years ago
Summary: Add a js-compartment-count memory reporter → Add memory reporters to count compartments
(Assignee)

Comment 4

6 years ago
Created attachment 547321 [details] [diff] [review]
patch, v2

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)

Updated

6 years ago
Attachment #547321 - Flags: review?(gal) → review+
(Assignee)

Comment 5

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/9bb30262e230
Whiteboard: [MemShrink] → [MemShrink][inbound]
http://hg.mozilla.org/mozilla-central/rev/9bb30262e230
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [MemShrink][inbound] → [MemShrink]
Target Milestone: --- → mozilla8

Comment 7

6 years ago
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")?
(Assignee)

Comment 8

6 years ago
(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.