Closed
Bug 1398854
Opened 7 years ago
Closed 7 years ago
Report the memory taken by CSS rules and declaration blocks
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: bzbarsky, Assigned: n.nethercote)
References
Details
(Whiteboard: [MemShrink])
Looking at dmd output on gmail, I was seeing two large sources of unreported stylesheet memory, both allocated from _$LT$style..stylesheets..rule_parser..NestedRuleParser$LT$$u27$a$C$$u20$$u27$b$C$$u20$R$GT$$u20$as$u20$cssparser..rules_and_declarations..QualifiedRuleParser$LT$$u27$i$GT$$GT$::parse_block::h399bd1e34421d327 (geckoservo.cgu-0.rs:?) These two source are the rules themselves and their declaration blocks. We report the memory those things point to, but not their own memory. The reason for not reporting the rules is that in CssRule's malloc_size_of_children impl (in servo/components/style/stylesheets/mod.rs) we do: CssRule::Style(ref lock) => { lock.read_with(guard).malloc_size_of_children(guard, malloc_size_of) }, In this case "lock" is an Arc<Locked<StyleRule>>. The read_with() call dereferences the Arc, so we call malloc_size_of_children on the StyleRule. But we're not measuring the memory the Arc itself points to. Similarly, in style_rule.rs we have: n += self.block.read_with(guard).malloc_size_of_children(malloc_size_of); which doesn't measure the memory pointed to by self.block (another Arc<Locked>). These two bits add up to about 4.5MB on gmail. I have local hacks to measure them, but really we should base this fix on bug 1398737 and then implement stuff for Arc<Locked<T>> that does the right thing (whether directly, or by implementing thigns for Arc<T> and Locked<T> separately). Then we can look for cases where we're doing foo.read_with(guard).size_of() and switch to foo.size_of() instead, right?
Updated•7 years ago
|
Whiteboard: [MemShrink]
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → n.nethercote
Assignee | ||
Comment 1•7 years ago
|
||
https://github.com/servo/servo/pull/18455
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
status-firefox55:
--- → wontfix
status-firefox56:
--- → wontfix
status-firefox57:
--- → affected
status-firefox-esr52:
--- → wontfix
Assignee | ||
Comment 2•7 years ago
|
||
This landed on the Gecko side.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•