Closed
Bug 1246855
Opened 8 years ago
Closed 8 years ago
Fix up CompartmentPrivate memory reporting
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(2 files)
3.95 KB,
patch
|
terrence
:
review+
|
Details | Diff | Splinter Review |
13.47 KB,
patch
|
terrence
:
review+
|
Details | Diff | Splinter Review |
Bug 1214961 added some memory reporting of CompartmentPrivate. But there are two shortcomings: - CompartmentPrivate::SizeOfIncludingThis() only measures part of mWrappedJS. - The measurement happens upon compartment creation. This confuses DMD, which assumes that measurement occurs during reporting, rather than in advance. Please r? me in the future for patches that involve non-trivial memory reporting changes!
Assignee | ||
Comment 1•8 years ago
|
||
Oh, also: - The "private-data" measurement in about:memory was put in the "dom" sub-tree instead of the "js-compartment" sub-tree.
Assignee | ||
Comment 2•8 years ago
|
||
Measuring in advance confuses DMD. It's better to measure during reporting. The next patch will reinstate the measurement, but during reporting.
Attachment #8717304 -
Flags: review?(terrence)
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → n.nethercote
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•8 years ago
|
||
terrence: "private-data" has this description:
> Extra data attached to the compartment by XPConnect, including
> wrapped-js that is local to a single compartment.
I find this awkward and unclear, for two reasons:
- Is "wrapped-js" an uncountable noun? Or should it be "a wrapped-js" or "the
wrapped-js" or "each wrapped-js" or something else?
- "that is local to a single compartment" -- this private data belongs to a
single compartment. Is phrase this redundant?
Alternative ways of writing it would be welcome. Thank you.
Attachment #8717305 -
Flags: review?(terrence)
Assignee | ||
Comment 4•8 years ago
|
||
I have confirmed that this causes a bunch of heap blocks to move from "Unreported" to "Once-reported" in DMD.
Updated•8 years ago
|
Attachment #8717304 -
Flags: review?(terrence) → review+
Comment 5•8 years ago
|
||
Comment on attachment 8717305 [details] [diff] [review] (part 2) - Measure CompartmentPrivates during memory reporting Review of attachment 8717305 [details] [diff] [review]: ----------------------------------------------------------------- I think either of the new phrasings you proposed is better than what's there now.
Attachment #8717305 -
Flags: review?(terrence) → review+
Assignee | ||
Comment 6•8 years ago
|
||
In JSCompartment::addSizeOfIncludingThis() I had to change this: > JSRuntime* rt = runtimeFromMainThread(); > auto callback = rt->sizeOfIncludingThisCompartmentCallback; to this: > auto callback = runtime_->sizeOfIncludingThisCompartmentCallback; to avoid some assertion failures in js::CurrentThreadCanAccessRuntime().
Assignee | ||
Comment 7•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/24529b78e2eb5ba8f4deb0b61810f248dc1705aa Bug 1246855 (part 1) - Remove the in-advance measurement of CompartmentPrivates. r=terrence. https://hg.mozilla.org/integration/mozilla-inbound/rev/99bef2f7a333546e90de4a11094b1ab3f507dcfe Bug 1246855 (part 2) - Measure CompartmentPrivates during memory reporting. r=terrence.
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/24529b78e2eb https://hg.mozilla.org/mozilla-central/rev/99bef2f7a333
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•