Closed Bug 702984 Opened 13 years ago Closed 13 years ago

CSS Rulehash memory reporter may undercount memory usage

Categories

(Core :: CSS Parsing and Computation, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: justin.lebar+bug, Assigned: n.nethercote)

References

Details

(Whiteboard: [MemShrink])

In bug 702301 comment 9, we saw the following DMD output:

==24692== Unreported: 3,145,728 (cumulative: 58,999,300) bytes in 16 heap block(s) in record 5 of 34899:
==24692==  Requested bytes unreported: 3,145,728 / 3,145,728
==24692==  Slop      bytes unreported: 0 / 0
==24692==    at 0x4C276AA: malloc (vg_replace_malloc.c:263)
==24692==    by 0x87A51C6: ChangeTable(PLDHashTable*, int) (pldhash.cpp:565)
==24692==    by 0x87A5657: PL_DHashTableOperate (pldhash.cpp:650)
==24692==    by 0x800EB77: RuleHash::AppendRuleToTable(PLDHashTable*, void const*, RuleSelectorPair const&) (nsCSSRuleProcessor.cpp:563)
==24692==    by 0x800EBE1: RuleHash::AppendRule(RuleSelectorPair const&) (nsCSSRuleProcessor.cpp:595)
==24692==    by 0x8011212: nsCSSRuleProcessor::RefreshRuleCascade(nsPresContext*) (nsCSSRuleProcessor.cpp:2784)
==24692==    by 0x8011386: nsCSSRuleProcessor::GetRuleCascade(nsPresContext*) (nsCSSRuleProcessor.cpp:3038)
==24692==    by 0x8011834: nsCSSRuleProcessor::RulesMatching(AnonBoxRuleProcessorData*) (nsCSSRuleProcessor.cpp:2307)
==24692==    by 0x80414C7: bool EnumRulesMatching<AnonBoxRuleProcessorData>(nsIStyleRuleProcessor*, void*) (nsStyleSet.cpp:477)
==24692==    by 0x80436C9: nsStyleSet::FileRules(bool (*)(nsIStyleRuleProcessor*, void*), void*, nsIContent*, nsRuleWalker*) (nsStyleSet.cpp:785)
==24692==    by 0x8043A66: nsStyleSet::ResolveAnonymousBoxStyle(nsIAtom*, nsStyleContext*) (nsStyleSet.cpp:1207)
==24692==    by 0x7F49514: nsCSSFrameConstructor::ConstructRootFrame(nsIFrame**) (nsCSSFrameConstructor.cpp:2541)

This is a bit strange since a memory reporter for this was added in bug 676048.

Nick, is it possible that the DMD patch just isn't aware of this memory reporter?
Is nsCSSRuleProcessor::SizeOf ever called?  DXR says no, but that could be wrong.

http://dxr.mozilla.org/mozilla/mozilla-central/layout/style/nsCSSRuleProcessor.cpp.html#l2561
Blocks: 676048
Okay, yes, it's called.  I wonder if this is just a DMD false negative.
Actually ccing Nick.
Yeah, the patch in bug 676724 telling DMD about memory reporters doesn't have annotations for style stuff.  I'm planning to convert all the existing reporters to use the new style from bug 698968, which will mean they don't need any annotations for DMD to know about them.

I'll assume this bug report is invalid for now, and if anything is missing after I convert I'll file new bugs.
Assignee: nobody → nnethercote
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Whiteboard: [MemShrink]
You need to log in before you can comment on or make changes to this bug.