large memory use by Facebook worker compartment

RESOLVED INVALID

Status

()

Firefox
SocialAPI: Providers
P1
normal
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: davida, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P1])

(Reporter)

Description

5 years ago
I'm seeing a 1.1G process, with fb as the top compartment AFAICT:

Main Process

Explicit Allocations
1,241.74 MB (100.0%) -- explicit
├────766.04 MB (61.69%) -- js-non-window
│    ├──418.98 MB (33.74%) -- compartments
│    │  ├──396.37 MB (31.92%) -- non-window-global
│    │  │  ├──208.46 MB (16.79%) -- compartment(https://www.facebook.com/desktop/fbdesktop2/socialfox/fbworker.js.php, [anonymous sandbox] (from: resource://gre/modules/FrameWorker.jsm:109))
│    │  │  │  ├──162.75 MB (13.11%) -- gc-heap
│    │  │  │  │  ├───76.01 MB (06.12%) -- objects
│    │  │  │  │  │   ├──59.45 MB (04.79%) ── non-function
│    │  │  │  │  │   └──16.56 MB (01.33%) ── function
│    │  │  │  │  ├───52.73 MB (04.25%) ── unused-gc-things
│    │  │  │  │  ├───25.80 MB (02.08%) -- shapes
│    │  │  │  │  │   ├──14.99 MB (01.21%) ── dict
│    │  │  │  │  │   └──10.80 MB (00.87%) ++ (2 tiny)
│    │  │  │  │  └────8.21 MB (00.66%) ++ (4 tiny)
│    │  │  │  ├───22.32 MB (01.80%) -- shapes-extra
│    │  │  │  │   ├──17.68 MB (01.42%) ── dict-tables
│    │  │  │  │   └───4.64 MB (00.37%) ++ (3 tiny)
│    │  │  │  ├───18.03 MB (01.45%) -- objects
│    │  │  │  │   ├──14.67 MB (01.18%) ── slots
│    │  │  │  │   └───3.36 MB (00.27%) ++ (2 tiny)
│    │  │  │  └────5.36 MB (00.43%) ++ (7 tiny)
│    │  │  ├──117.82 MB (09.49%) ++ (663 tiny)
│    │  │  ├───39.43 MB (03.18%) -- compartment([System Principal], resource://gre/modules/FrameWorker.jsm)
│    │  │  │   ├──22.03 MB (01.77%) -- gc-heap
│    │  │  │   │  ├──17.56 MB (01.41%) -- objects
│    │  │  │   │  │  ├──17.55 MB (01.41%) ── non-function
│    │  │  │   │  │  └───0.01 MB (00.00%) ── function
│    │  │  │   │  └───4.47 MB (00.36%) ++ (5 tiny)
│    │  │  │   └──17.40 MB (01.40%) ++ (8 tiny)
│    │  │  ├───18.21 MB (01.47%) ++ compartment([System Principal], resource://jid1-isk94hguf3fsra-at-jetpack/about-profile/lib/Demographer.js (from: resource://jid1-isk94hguf3fsra-at-jetpack/api-utils/lib/loader.js:137))
│    │  │  └───12.45 MB (01.00%) ++ compartment([System Principal], [anonymous sandbox] (from: resource://openwebapps-at-mozillalabs-dot-com/api-utils/lib/cuddlefish.js:55))
│    │  └───22.61 MB (01.82%) -- no-global
│    │      ├──22.59 MB (01.82%) -- compartment(atoms)
│    │      │  ├──13.55 MB (01.09%) -- gc-heap
│    │      │  │  ├──13.16 MB (01.06%) ── strings
│    │      │  │  └───0.39 MB (00.03%) ++ (2 tiny)
│    │      │  └───9.05 MB (00.73%) ++ (2 tiny)
│    │      └───0.02 MB (00.00%) ++ compartment([System Principal], about:blank)
│    ├──322.96 MB (26.01%) -- gc-heap
│    │  ├──311.34 MB (25.07%) ── decommitted-arenas
│    │  └───11.63 MB (00.94%) ++ (3 tiny)
│    └───24.09 MB (01.94%) ++ runtime
├────316.15 MB (25.46%) -- window-objects
│    ├───74.74 MB (06.02%) ++ (21 tiny)
│    ├───72.54 MB (05.84%) -- top(https://mail.google.com/mail/u/1/?shva=1#inbox, id=18805)/active
│    │   ├──40.18 MB (03.24%) -- window(https://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=Trj5nnYfgSE.en./sv=1/am=!0UcZ2ATXw2hRBNmSG6sLQtHz-yokPrU17JPdt17dDCtb76HdsCYVsJFB8DAQKKzOny10/d=1)
│    │   │  ├──38.49 MB (03.10%) -- js
│    │   │  │  ├──38.28 MB (03.08%) -- compartment(https://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=Trj5nnYfgSE.en./sv=1/am=!0UcZ2ATXw2hRBNmSG6sLQtHz-yokPrU17JPdt17dDCtb76HdsCYVsJFB8DAQKKzOny10/d=1)
│    │   │  │  │  ├──20.50 MB (01.65%) ++ (9 tiny)
│    │   │  │  │  └──17.78 MB (01.43%) ++ gc-heap
│    │   │  │  └───0.21 MB (00.02%) ++ compartment(https://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=Trj5nnYfgSE.en./sv=1/am=!0UcZ2ATXw2hRBNmSG6sLQtHz-yokPrU17JPdt17dDCtb76HdsCYVsJFB8DAQKKzOny10/d=1, about:blank)
│    │   │  └───1.68 MB (00.14%) ++ (3 tiny)
│    │   ├──19.22 MB (01.55%) ++ (5 tiny)
│    │   └──13.14 MB (01.06%) ++ window(https://mail.google.com/mail/u/1/?shva=1#inbox)
│    ├───50.59 MB (04.07%) -- top(https://www.yammer.com/mozilla.com/#/Threads/index?type=following, id=33338)/active/window(https://www.yammer.com/mozilla.com/#/Threads/index?type=following)
│    │   ├──41.75 MB (03.36%) -- js/compartment(https://www.yammer.com/mozilla.com/)
│    │   │  ├──23.39 MB (01.88%) ++ gc-heap
│    │   │  └──18.36 MB (01.48%) ++ (9 tiny)
│    │   └───8.84 MB (00.71%) ++ (4 tiny)
│    ├───43.22 MB (03.48%) -- top(https://drive.google.com/?tab=mo&authuser=1#my-drive, id=33368)/active
│    │   ├──38.36 MB (03.09%) -- window(https://drive.google.com/?tab=mo&authuser=1#my-drive)
│    │   │  ├──31.29 MB (02.52%) -- js
│    │   │  │  ├──31.08 MB (02.50%) -- compartment(https://drive.google.com/?tab=mo&authuser=1)
│    │   │  │  │  ├──17.12 MB (01.38%) ++ gc-heap
│    │   │  │  │  └──13.96 MB (01.12%) ++ (9 tiny)
│    │   │  │  └───0.21 MB (00.02%) ++ compartment(https://drive.google.com/?tab=mo&authuser=1, about:blank)
│    │   │  └───7.07 MB (00.57%) ++ (4 tiny)
│    │   └───4.86 MB (00.39%) ++ (2 tiny)
│    ├───24.43 MB (01.97%) -- top(https://www.facebook.com/desktop/client/tickerflyout.php?socialfox=true&access_token=AAAD7ryIZCqu0BADkESHweiI1fwAm0RTvWusWRyPgDe0vPzOgiHIzmXCzrenmmWLdTUjDRJVFOl97QQ0xAe4iZCKVBZBkyKzbkQtq2aPOOkje9JWQbaK, id=22508)/active/window(https://www.facebook.com/desktop/client/tickerflyout.php?socialfox=true&access_token=AAAD7ryIZCqu0BADkESHweiI1fwAm0RTvWusWRyPgDe0vPzOgiHIzmXCzrenmmWLdTUjDRJVFOl97QQ0xAe4iZCKVBZBkyKzbkQtq2aPOOkje9JWQbaK)
│    │   ├──16.66 MB (01.34%) ++ js/compartment(https://www.facebook.com/desktop/client/tickerflyout.php?socialfox=true&access_token=AAAD7ryIZCqu0BADkESHweiI1fwAm0RTvWusWRyPgDe0vPzOgiHIzmXCzrenmmWLdTUjDRJVFOl97QQ0xAe4iZCKVBZBkyKzbkQtq2aPOOkje9JWQbaK)
│    │   └───7.77 MB (00.63%) ++ (4 tiny)
│    ├───19.19 MB (01.55%) -- top(https://etherpad.mozilla.org/tjQ7IWN1Q0, id=27989)/active
│    │   ├──18.97 MB (01.53%) -- window(https://etherpad.mozilla.org/tjQ7IWN1Q0)
│    │   │  ├──13.89 MB (01.12%) ++ js
│    │   │  └───5.09 MB (00.41%) ++ (4 tiny)
│    │   └───0.22 MB (00.02%) ++ window(about:blank)
│    ├───16.58 MB (01.34%) -- top(none)/detached
│    │   ├──12.81 MB (01.03%) -- window([system])
│    │   │  ├──12.80 MB (01.03%) ++ js/compartment([System Principal], about:blank)
│    │   │  └───0.01 MB (00.00%) ── dom/other [10]
│    │   └───3.77 MB (00.30%) ++ window(https://plus.google.com/u/1/_/streamwidgets/canvas)
│    └───14.87 MB (01.20%) ++ top(https://www.facebook.com/desktop/client/page.php?socialfox=true&access_token=AAAD7ryIZCqu0BADkESHweiI1fwAm0RTvWusWRyPgDe0vPzOgiHIzmXCzrenmmWLdTUjDRJVFOl97QQ0xAe4iZCKVBZBkyKzbkQtq2aPOOkje9JWQbaK, id=293)/active/window(https://www.facebook.com/desktop/client/page.php?socialfox=true&access_token=AAAD7ryIZCqu0BADkESHweiI1fwAm0RTvWusWRyPgDe0vPzOgiHIzmXCzrenmmWLdTUjDRJVFOl97QQ0xAe4iZCKVBZBkyKzbkQtq2aPOOkje9JWQbaK)
├─────93.65 MB (07.54%) ── heap-unclassified
├─────37.43 MB (03.01%) ++ (14 tiny)
└─────28.48 MB (02.29%) -- storage
      ├──26.98 MB (02.17%) ++ sqlite
      └───1.49 MB (00.12%) ++ prefixset

Other Measurements
922 (100.0%) -- js-compartments
├──784 (85.03%) ── system
└──138 (14.97%) ── user

1,010.02 MB (100.0%) -- js-main-runtime
├────662.97 MB (65.64%) -- compartments
│    ├──421.04 MB (41.69%) -- gc-heap
│    │  ├──167.17 MB (16.55%) -- objects
│    │  │  ├──123.24 MB (12.20%) ── non-function
│    │  │  └───43.93 MB (04.35%) ── function
│    │  ├──129.52 MB (12.82%) ── unused-gc-things
│    │  ├───63.09 MB (06.25%) -- shapes
│    │  │   ├──29.50 MB (02.92%) ── dict
│    │  │   ├──18.07 MB (01.79%) ── base
│    │  │   └──15.52 MB (01.54%) ── tree
│    │  ├───30.86 MB (03.06%) ── strings
│    │  ├───20.30 MB (02.01%) ── scripts
│    │  └───10.10 MB (01.00%) ++ (3 tiny)
│    ├───54.89 MB (05.43%) ── analysis-temporary
│    ├───50.82 MB (05.03%) -- shapes-extra
│    │   ├──28.93 MB (02.86%) ── dict-tables
│    │   ├──11.71 MB (01.16%) ── compartment-tables
│    │   └──10.17 MB (01.01%) ++ (2 tiny)
│    ├───41.64 MB (04.12%) ── script-data
│    ├───41.02 MB (04.06%) -- objects
│    │   ├──34.55 MB (03.42%) ── slots
│    │   └───6.47 MB (00.64%) ++ (2 tiny)
│    ├───25.94 MB (02.57%) -- string-chars
│    │   ├──16.31 MB (01.61%) ── non-huge
│    │   └───9.64 MB (00.95%) ++ huge
│    ├───15.77 MB (01.56%) ── cross-compartment-wrappers
│    └───11.85 MB (01.17%) ++ (6 tiny)
├────322.96 MB (31.98%) -- gc-heap
│    ├──311.34 MB (30.82%) ── decommitted-arenas
│    ├───11.63 MB (01.15%) ── chunk-admin
│    └────0.00 MB (00.00%) ++ (2 tiny)
└─────24.09 MB (02.39%) ── runtime

432.66 MB (100.0%) -- js-main-runtime-gc-heap-committed
├──303.15 MB (70.07%) -- used
│  ├──285.24 MB (65.93%) ── gc-things
│  ├───11.63 MB (02.69%) ── chunk-admin
│  └────6.28 MB (01.45%) ── arena-admin
└──129.52 MB (29.93%) -- unused
   ├──129.52 MB (29.93%) ── gc-things
   └────0.00 MB (00.00%) ++ (2 tiny)

72.17 MB (100.0%) -- window-objects
├──26.50 MB (36.73%) -- layout
│  ├──13.68 MB (18.96%) ── style-sets
│  ├───5.58 MB (07.73%) ── pres-shell
│  ├───3.06 MB (04.24%) ── frames
│  ├───1.38 MB (01.91%) ── pres-contexts
│  ├───1.31 MB (01.82%) ── style-contexts
│  ├───0.98 MB (01.36%) ── rule-nodes
│  └───0.50 MB (00.70%) ++ (2 tiny)
├──26.09 MB (36.15%) ── style-sheets
├──19.38 MB (26.86%) -- dom
│  ├───6.95 MB (09.63%) ── orphan-nodes
│  ├───5.88 MB (08.14%) ── element-nodes
│  ├───5.08 MB (07.04%) ── text-nodes
│  ├───1.44 MB (01.99%) ── other
│  └───0.04 MB (00.06%) ++ (2 tiny)
└───0.19 MB (00.26%) ── property-tables

    0.00 MB ── canvas-2d-pixel-bytes
1,241.51 MB ── explicit
    4.53 MB ── gfx-surface-image
          0 ── ghost-windows
  487.98 MB ── heap-allocated
  557.74 MB ── heap-committed
   69.75 MB ── heap-committed-unused
     14.29% ── heap-committed-unused-ratio
    2.22 MB ── heap-dirty
  430.01 MB ── heap-unused
    3.88 MB ── images-content-used-uncompressed
  744.00 MB ── js-gc-heap
    193,813 ── page-faults-hard
 15,646,803 ── page-faults-soft
1,186.68 MB ── resident
   26.98 MB ── storage-sqlite
5,158.67 MB ── vsize
(Reporter)

Comment 1

5 years ago
fyi, my sidebar is closed, i have one window running, and am running:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/19.0 Firefox/19.0

Built from http://hg.mozilla.org/mozilla-central/rev/cb573b9307e5

(not sure why about:support isn't showing me a timestamp on nightly)
Thanks, that about:memory data is useful.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 805246
Florian/Pam: That 208MB compartment for the worker JS looks quite worrisome. Do you guys have any ideas what could be going on here?
Does this bug affect 17.0 Beta? and if so, should we consider this a potential blocker?

Comment 5

5 years ago
How long had you had Firefox running at that point? We're adding logic to reload that worker every few hours which should provide some relief from this sort of memory bloat for people running their browser for a long time.
(In reply to Florian Laplantif from comment #5)
> How long had you had Firefox running at that point? We're adding logic to
> reload that worker every few hours which should provide some relief from
> this sort of memory bloat for people running their browser for a long time.

Do you have any insights into what might be causing the leaks?  Given the worker doesn't have content, the "usual suspects" (eg, a never ending list of new DOM nodes etc) probably don't apply, so it might be pointing at platform issues we could address if they can be identified.
Yeah - I think periodic reloading is a good idea, but we shouldn't use it as a crutch. If we're leaking stuff or causing too much memory pressure, that's a problem even if we periodically "fix" it with a reload.
Status: RESOLVED → REOPENED
Component: SocialAPI → SocialAPI: Providers
Resolution: DUPLICATE → ---
Summary: Large memory use → large memory use by Facebook worker compartment
Blocks: 805246

Comment 8

5 years ago
I have never seen the worker go up above 30 Megs of memory when running it, and I've let Firefox open on my laptop for days while receiving probably way more chats and notifications/ticker stories than the average Facebook user... 

I'd be interested if someone who does repro this could give more details about what categories they are seeing spiking under the worker itself, maybe that could give a better idea of where I need to look, right now it's pretty much a needle in a haystack (since I can't repro)... :/

Comment 9

5 years ago
I guess someone did post that above... What are objects under gc-heap exactly? Are they objects already marked to be GC'd?

Comment 10

5 years ago
Also what are "shapes"?
"Shapes" are like dynamically generated types for JS objects.
Whiteboard: [MemShrink]

Comment 12

5 years ago
Ok. I don't see why there would be 50 megs of "shapes" we're not doing anything weird with having JS objects that constantly change what variables they have or have dynamically generated property names, so I don't see why we would have so much memory used by "shapes"... :/
Shape usage correlates with object usage, and 63 MiB of shapes combined with 167 MiB of objects is pretty normal.  You can just focus on the objects and ignore the shapes.

Also, if you load about:memory and hover over any entry you get a description of what that entry is measuring.
OS: Mac OS X → All
Priority: -- → P1
Hardware: x86 → All
Version: unspecified → Trunk
Whiteboard: [MemShrink] → [MemShrink:P1]
As far as I know we have only one report of this (from David) and no one else has been able to reproduce this.

David, are you still seeing similar issues?
Flags: needinfo?(dascher)
(Reporter)

Comment 15

5 years ago
I've disabled the social stuff to try and isolate whether my leaks were due to it.  So far, results are inconclusive.  will try re-enabling now that i've disabled some other addons.  I'm fine w/ RESOLVED WFM if this bug is not useful.
Flags: needinfo?(dascher)
(In reply to David Ascher (:davida) from comment #15)
> I've disabled the social stuff to try and isolate whether my leaks were due
> to it.  So far, results are inconclusive.  will try re-enabling now that
> i've disabled some other addons.  I'm fine w/ RESOLVED WFM if this bug is
> not useful.

It's been over a month.  I'm going to assume that there is no new, clear evidence of a problem.  David, please reopen this bug if that's not the case.
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.