Closed
Bug 1487198
Opened 7 years ago
Closed 7 years ago
Consider memory-reporting more things on DocumentOrShadowRoot
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
With the memory reporting DocumentOrShadowRoot does after bug 1486623, we should consider moving more things into DocumentOrShadowRoot::SizeOfExcludingThis.
As a specific example, nsDocument::DocAddSizeOfExcludingThis has:
aWindowSizes.mDOMOtherSize +=
mIdentifierMap.SizeOfExcludingThis(aWindowSizes.mState.mMallocSizeOf);
and we should move that up into DocumentOrShadowRoot. I am looking at a DMD log shows this (due to elements with ids in an <svg:use> subtree):
Unreported {
2,201 blocks in heap block record 11 of 6,988
2,253,824 bytes (1,408,640 requested / 845,184 slop)
Individual block sizes: 1,024 x 2,201
0.47% of the heap (20.64% cumulative)
1.27% of unreported (56.08% cumulative)
Allocated at {
#01: replace_calloc(unsigned long, unsigned long) (DMD.cpp:1282, in libmozglue.dylib)
#02: PLDHashTable::Add(void const*, std::nothrow_t const&) (PLDHashTable.h:245, in XUL)
#03: PLDHashTable::Add(void const*) (PLDHashTable.cpp:619, in XUL)
#04: mozilla::dom::ShadowRoot::AddToIdTable(mozilla::dom::Element*, nsAtom*) (nsTHashtable.h:156, in XUL)
#05: mozilla::dom::Element::BindToTree(nsIDocument*, nsIContent*, nsIContent*) (Element.cpp:0, in XUL)
#06: nsSVGElement::BindToTree(nsIDocument*, nsIContent*, nsIContent*) (nsSVGElement.cpp:240, in XUL)
#07: nsINode::InsertChildBefore(nsIContent*, nsIContent*, bool) (nsINode.cpp:1412, in XUL)
#08: mozilla::dom::SVGUseElement::UpdateShadowTree() (RefPtr.h:42, in XUL)
}
}
Of course it's worth figuring out whether this hashtable ever gets used in the <svg:use> case...
| Reporter | ||
Comment 1•7 years ago
|
||
I guess mDOMStyleSheets is the only other thing on DocumentOrShadowRoot that might need memory reporting...
| Assignee | ||
Comment 2•7 years ago
|
||
Yeah, can get to this tomorrow.
The identifier map is actually used, it's needed to efficiently lookup idrefs in Shadow DOM subtrees... Though for <svg:use> we jump over them so we could potentially avoid doing it.
Flags: needinfo?(emilio)
| Assignee | ||
Comment 3•7 years ago
|
||
Given it doesn't have it in document, I'll just move the identifier map for now.
Assignee: nobody → emilio
Flags: needinfo?(emilio)
| Assignee | ||
Comment 4•7 years ago
|
||
Comment 5•7 years ago
|
||
Comment on attachment 9005060 [details]
Measure memory usage of the identifier map in ShadowRoot as well.
Olli Pettay [:smaug] has approved the revision.
Attachment #9005060 -
Flags: review+
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/48f88e237b4e
Measure memory usage of the identifier map in ShadowRoot as well. r=smaug
Comment 7•7 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•