Closed Bug 752381 Opened 8 years ago Closed 8 years ago

Merge System Principal compartments in about:memory

Categories

(Core :: XPConnect, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: njn, Assigned: njn)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

Bug 672439 added addresses to the memory reporters of System Principal compartments so they weren't all lumped together.  But now that CPG creates 100s of such compartments at a drop of a hat, these addresses are making about:memory very hard to read.

Also, the sheer amount of text in about:memory -- every one of those hundreds of compartments gets up to 34 lines -- is perturbing the measurement greatly.  When I hit reload in about:memory repeatedly it bounces around sometimes as much as 100MB or more, which is ridiculous and renders about:memory almost unusable.

So I'm going to remove the addresses.  We have names for some system principal compartments (e.g. sandboxes) so they'll still be shown separately, which is good.
Whiteboard: [MemShrink]
> Also, the sheer amount of text in about:memory -- every one of those
> hundreds of compartments gets up to 34 lines -- is perturbing the
> measurement greatly.  When I hit reload in about:memory repeatedly it
> bounces around sometimes as much as 100MB or more, which is ridiculous and
> renders about:memory almost unusable.

Hmm, I wonder if this accounts for any of that 3--5% CPG overhead measured by bholley, luke and AWSY...
Attached patch patchSplinter Review
The patch is trivial.  Asking jlebar for review because this is more about about:memory than XPConnect.

Example output with the patch applied:

87,961,551 B (100.0%) -- explicit
├──48,332,712 B (54.95%) -- js
│  ├──37,104,064 B (42.18%) -- compartment([System Principal])
│  │  ├──26,374,144 B (29.98%) -- gc-heap
│  │  │  ├──13,024,304 B (14.81%) -- objects
│  │  │  │  ├──10,598,448 B (12.05%) ── non-function [112]
│  │  │  │  └───2,425,856 B (02.76%) ── function [109]
│  │  │  ├───5,714,480 B (06.50%) -- arena
│  │  │  │   ├──5,288,368 B (06.01%) ── unused [112]
│  │  │  │   ├────220,064 B (00.25%) ── padding [112]
│  │  │  │   └────206,048 B (00.23%) ── headers [112]
│  │  │  ├───3,171,200 B (03.61%) ── strings [80]
│  │  │  ├───3,083,448 B (03.51%) -- shapes
│  │  │  │   ├──1,673,800 B (01.90%) ── tree [112]
│  │  │  │   ├────785,640 B (00.89%) ── dict [109]
│  │  │  │   └────624,008 B (00.71%) ── base [112]
│  │  │  ├───1,274,520 B (01.45%) ── scripts [109]
│  │  │  ├─────106,032 B (00.12%) ── type-objects [112]
│  │  │  └─────────160 B (00.00%) ── xml
│  │  ├───3,672,704 B (04.18%) ── analysis-temporary [17]
│  │  ├───2,932,000 B (03.33%) ── script-data [109]
│  │  ├───2,074,336 B (02.36%) -- shapes-extra
│  │  │   ├────903,168 B (01.03%) ── compartment-tables [113]
│  │  │   ├────470,816 B (00.54%) ── tree-tables [50]
│  │  │   ├────357,248 B (00.41%) ── dict-tables [109]
│  │  │   └────343,104 B (00.39%) ── tree-shape-kids [109]
│  │  ├───1,453,808 B (01.65%) -- objects
│  │  │   ├────914,112 B (01.04%) ── slots [112]
│  │  │   ├────520,688 B (00.59%) ── elements [81]
│  │  │   └─────19,008 B (00.02%) ── misc [112]
│  │  ├─────434,128 B (00.49%) ── string-chars [80]
│  │  └─────162,944 B (00.19%) -- type-inference
│  │        ├──131,888 B (00.15%) ── script-main [69]
│  │        ├───23,904 B (00.03%) ── tables [6]
│  │        └────7,152 B (00.01%) ── object-main [5]
Does it have a noticeable effect on how much memory the browser uses with just about:memory?verbose open?
Blocks: 752357
Attachment #621486 - Flags: review?(justin.lebar+bug)
Blocks: 752259
I'm a bit concerned about the information that's being hidden.  There's a fragmentation concern with CPG that we can't analyze as effectively with this patch.

But we obviously need to do it, and we can address this concern when we need to analyze it.
Attachment #621486 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/929610b0c428
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.