Closed Bug 986300 Opened 6 years ago Closed 6 years ago

Fix a tricky corner case involving memory report diffs

Categories

(Toolkit :: about:memory, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: njn, Assigned: njn)

References

(Blocks 1 open bug)

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

Imagine we're diffing two sets of memory reports. One has this sub-tree:

├─────674,416 B (01.29%) ── xpconnect

and the other has this sub-tree:

├───3,414,328 B (04.19%) -- xpconnect
│   ├──2,531,328 B (03.11%) ── proto-iface-cache
│   ├────675,632 B (00.83%) ── scopes
│   ├────143,464 B (00.18%) ── runtime
│   └─────63,904 B (00.08%) ── js-component-loader

Hmm, tricky. It's not immediately obvious how these sub-trees should be diff'd,
and about:memory currently asserts when it happens.

This hasn't come up before now because normally diffs are done between very
similar or identical builds of Firefox. But I just tried comparing a trunk
Firefox with one from a year ago, and I hit this problem.
This patch fixes the problem. Here's the output for the above example.

├───2,739,912 B (09.41%) -- xpconnect [-]
│   ├──2,531,328 B (08.69%) ── proto-iface-cache [+]
│   ├────675,632 B (02.32%) ── scopes [+]
│   ├───-674,416 B (-2.32%) ── (fake child) [!]
│   ├────143,464 B (00.49%) ── runtime [+]
│   └─────63,904 B (00.22%) ── js-component-loader [+]

It inserts a fake node, effectively replacing the "xpconnect" entry from the
first reports with "xpconnect/(fake child)". This makes the comparison
straightforward. If you hover over the "[!]" you get a tool-tip explaining that
it's a fake node added purely to enable the diff.
Attachment #8394546 - Flags: review?(bugmail.mozilla)
Whiteboard: [MemShrink]
Blocks: 986323
Attachment #8394546 - Flags: review?(bugmail.mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/f507ce23308b
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.