Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Tweak per-compartment memory reporting

RESOLVED FIXED in Firefox 18



JavaScript Engine
5 years ago
5 years ago


(Reporter: njn, Assigned: njn)


(Blocks: 1 bug)


Firefox Tracking Flags

(firefox18 fixed)


(Whiteboard: [MemShrink])


(1 attachment)



5 years ago
Patch coming shortly.

Comment 1

5 years ago
Created attachment 669028 [details] [diff] [review]
Tweak per-compartment memory reporting.

This patch:

- Creates Compartment::sizeOfIncludingThis() and moves some pre-existing code
  into it.

- Adds new measurement of Compartment::regExps.  Note that I'm measuring the
  hash table itself, but not measuring any of the RegExpShared objects
  pointed to by the table;  DMD indicates there's no need.

- Adds new measurement of Compartment::debuggees.

- Moves the memory reporting of JSCompartment objects themselves from
  runtime/compartment-objects to $COMPARTMENT/compartment-objects, which is a
  more logical place for it.

The two new reporters improve coverage of 64-bit desktop start-up by about
200KB, i.e. roughly 0.5%.
Attachment #669028 - Flags: review?(Ms2ger)
Comment on attachment 669028 [details] [diff] [review]
Tweak per-compartment memory reporting.

Review of attachment 669028 [details] [diff] [review]:

Gah, how did I end up owning this?

::: js/src/jscompartment.cpp
@@ +855,4 @@
>  {
> +    *compartmentObject = mallocSizeOf(this);
> +    sizeOfTypeInferenceData(tiSizes, mallocSizeOf);
> +    *shapesCompartmentTables = baseShapes.sizeOfExcludingThis(mallocSizeOf)

I have to admit that I have no idea what "shapesCompartmentTables" refers to.
Attachment #669028 - Flags: review?(Ms2ger) → review+

Comment 3

5 years ago
> Gah, how did I end up owning this?

IIRC, you were the one who created jsmemorymetrics.cpp :)  Thanks for reviewing, and quickly.  I can ask others to review these kinds of changes in the future if you don't want to.

> I have to admit that I have no idea what "shapesCompartmentTables" refers to.

It shows up in about:memory under |compartment(foo)/shapes-extra/compartment-tables|.

BTW, I used DMD to find and check these changes, which should give you some added confidence!


5 years ago
Blocks: 563700
Whiteboard: [MemShrink]

Comment 4

5 years ago

Comment 5

5 years ago
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Comment on attachment 669028 [details] [diff] [review]
Tweak per-compartment memory reporting.

[Approval Request Comment]
This is needed to make the changes in bug 801780 apply cleanly.  I can work around this, but I think it's less risky to take this patch.

It's also an improvement with respect to bug 798484, which is important for B2G.

Relatively low-risk patch, and taking it keeps aurora and nightly in sync, reducing pain for B2G.
Attachment #669028 - Flags: approval-mozilla-aurora?


5 years ago
Attachment #669028 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
status-firefox18: --- → fixed
You need to log in before you can comment on or make changes to this bug.