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

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: njn, Assigned: njn)

Tracking

(Blocks: 1 bug)

unspecified
mozilla19
Points:
---

Firefox Tracking Flags

(firefox18 fixed)

Details

(Whiteboard: [MemShrink])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Patch coming shortly.
(Assignee)

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+
(Assignee)

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!
(Assignee)

Updated

5 years ago
Blocks: 563700
Whiteboard: [MemShrink]
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/2494d51c3dc5

Comment 5

5 years ago
https://hg.mozilla.org/mozilla-central/rev/2494d51c3dc5
Status: NEW → RESOLVED
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?

Updated

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