Closed Bug 759250 Opened 14 years ago Closed 8 years ago

Investigate why XPCOMUtils.jsm uses so much memory

Categories

(Core :: XPConnect, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED INACTIVE

People

(Reporter: Unfocused, Unassigned)

Details

(Whiteboard: [Memshrink:P3])

Now we have compatment-per-global, it's easy to see how much memory each JSM is using. And on my Linux box, XPCOMUtils.jsm uses almost 2mb. This seems far too high - eg, XPIProvider.jsm is a huge mass of code but only uses less than half that.
Whiteboard: [Memshrink]
Presumably because all the lazy getters/setters people define with it live in its compartment, which also means there are a lot of cross-compartment wrappers floating around. But it's worth investigating for sure to see if we can do anything more clever.
Blair, can you post your about:memory contents for this module? I have 750KB in that module: │ ├──────765,360 B (00.21%) -- compartment([System Principal], resource://gre/modules/XPCOMUtils.jsm) │ │ ├──532,480 B (00.14%) -- gc-heap │ │ │ ├──318,256 B (00.09%) ── arena/unused │ │ │ ├──150,288 B (00.04%) -- objects │ │ │ │ ├──111,856 B (00.03%) ── non-function │ │ │ │ └───38,432 B (00.01%) ── function │ │ │ ├───24,272 B (00.01%) ── sundries │ │ │ ├───20,880 B (00.01%) ── shapes/tree │ │ │ ├───10,240 B (00.00%) ── strings │ │ │ └────8,544 B (00.00%) ── type-objects │ │ ├──131,072 B (00.04%) ── analysis-temporary │ │ ├───24,768 B (00.01%) ── objects/slots │ │ ├───24,576 B (00.01%) ── shapes-extra/compartment-tables │ │ ├───24,576 B (00.01%) ── cross-compartment-wrappers │ │ ├───15,168 B (00.00%) ── string-chars │ │ └───12,720 B (00.00%) ── other-sundries Nothing that unusual here. arena/unused is high but that's typical in the post-CPG world. This browser session is less than 2 hours old, though.
Whiteboard: [Memshrink] → [Memshrink:P3]
From my Windows 7 box, session is a minute old: │ ├────2,765,680 B (00.45%) -- compartment([System Principal], resource://gre/modules/XPCOMUtils.jsm) │ │ ├──1,708,032 B (00.28%) -- gc-heap │ │ │ ├────848,672 B (00.14%) -- objects │ │ │ │ ├──710,608 B (00.11%) ── non-function │ │ │ │ └──138,064 B (00.02%) ── function │ │ │ ├────756,072 B (00.12%) ── arena/unused │ │ │ ├─────44,584 B (00.01%) -- shapes │ │ │ │ ├──25,992 B (00.00%) ── tree │ │ │ │ └──18,592 B (00.00%) ── base │ │ │ ├─────40,928 B (00.01%) ── strings │ │ │ └─────17,776 B (00.00%) ── sundries │ │ ├────388,832 B (00.06%) -- shapes-extra │ │ │ ├──344,064 B (00.06%) ── compartment-tables │ │ │ └───44,768 B (00.01%) ── tree-tables │ │ ├────200,384 B (00.03%) ── objects/slots │ │ ├────196,608 B (00.03%) ── cross-compartment-wrappers │ │ ├────134,672 B (00.02%) ── string-chars │ │ ├────131,072 B (00.02%) ── analysis-temporary │ │ └──────6,080 B (00.00%) ── other-sundries
And on my Linux box, session is a minute old (both of these are latest Nightlies) │ ├────7,522,160 B (00.94%) -- compartment([System Principal], resource://gre/modules/XPCOMUtils.jsm) │ │ ├──4,554,752 B (00.57%) -- gc-heap │ │ │ ├──2,777,344 B (00.35%) -- objects │ │ │ │ ├──1,460,864 B (00.18%) ── non-function │ │ │ │ └──1,316,480 B (00.16%) ── function │ │ │ ├──1,385,728 B (00.17%) -- shapes │ │ │ │ ├────727,608 B (00.09%) ── base │ │ │ │ └────658,120 B (00.08%) ── tree │ │ │ ├────206,432 B (00.03%) ── strings │ │ │ ├────105,256 B (00.01%) -- arena │ │ │ │ ├───36,944 B (00.00%) ── unused │ │ │ │ ├───35,584 B (00.00%) ── headers │ │ │ │ └───32,728 B (00.00%) ── padding │ │ │ ├─────74,832 B (00.01%) ── type-objects │ │ │ └──────5,160 B (00.00%) ── sundries │ │ ├──1,427,872 B (00.18%) -- shapes-extra │ │ │ ├──1,376,256 B (00.17%) ── compartment-tables │ │ │ └─────51,616 B (00.01%) ── tree-tables │ │ ├────854,528 B (00.11%) ── objects/slots │ │ ├────342,160 B (00.04%) ── string-chars │ │ ├────196,608 B (00.02%) ── cross-compartment-wrappers │ │ ├────131,072 B (00.02%) ── analysis-temporary │ │ └─────15,168 B (00.00%) ── other-sundries
How many tabs do you have open in these sessions? Can you try with another profile? We need to narrow down the possible cause of the high numbers.
For me, on 64-bit, starting the browser in a new profile: │ │ │ ├─────392,896 B (00.35%) -- compartment([System Principal], resource://gre/modules/XPCOMUtils.jsm) And after using the browser for 7.5 hours with an old profile: │ │ │ ├─────759,208 B (00.06%) -- compartment([System Principal], resource://gre/modules/XPCOMUtils.jsm) Blair, do you still see high numbers?
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.