Open Bug 791865 Opened 12 years ago Updated 9 months ago

Google MapsGL Memory usage off the charts

Categories

(Firefox :: General, defect)

16 Branch
x86_64
Windows 7
defect

Tracking

()

People

(Reporter: rickmastfan67, Unassigned)

References

Details

(Whiteboard: [MemShrink:P2])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0

(This was done with a fresh profile and no add-ons installed)

Steps to reproduce:
1. Load the following page: https://maps.google.com/?ie=UTF8&ll=49.759688,-85.184921&spn=0.021541,0.066047&t=v&z=15&vpsrc=6
2. Activate "MapsGL" if it isn't already.
3. Now, go onto StreetView on the only road there that has it.
4. Center StreetView on the road's center line (doesn't matter which direction)
5. Start traveling in StreetView down Ontario 11 in jumps (don't use the arrows to follow the route, use the circle that shows up when you point your cursor into the distance on the image).
6. After 5 or 6 of the jumps down the map, start up the Task Manager and notice that firefox.exe is using over 1MB of memory.

Doing the steps above, I was able to once get firefox.exe over 2MB of memory used.
1 MB or 1 GB?

Could you post the memory log of about:memory?verbose, please.
That's what I get for typing and not paying attention. :facepalm:  Yes, 1GB/2GB.  I'll do the about:memory next as I need to restart and use the new profile to do it.
Main Process

Explicit Allocations
412.44 MB (100.0%) -- explicit
├──271.79 MB (65.90%) -- images
│  ├──271.33 MB (65.79%) -- content
│  │  ├──270.86 MB (65.67%) -- used
│  │  │  ├──249.16 MB (60.41%) ── uncompressed-heap
│  │  │  ├───21.70 MB (05.26%) ── raw
│  │  │  └────0.00 MB (00.00%) ── uncompressed-nonheap
│  │  └────0.48 MB (00.12%) ++ unused
│  └────0.46 MB (00.11%) ++ chrome
├───61.43 MB (14.89%) -- js-non-window
│   ├──38.18 MB (09.26%) -- compartments
│   │  ├──22.52 MB (05.46%) -- no-global
│   │  │  ├──22.51 MB (05.46%) -- compartment(atoms)
│   │  │  │  ├──21.66 MB (05.25%) ── string-chars
│   │  │  │  └───0.86 MB (00.21%) ++ (2 tiny)
│   │  │  └───0.01 MB (00.00%) ── compartment([System Principal], about:newtab)/other-sundries [2]
│   │  └──15.66 MB (03.80%) ++ non-window-global
│   ├──21.77 MB (05.28%) -- gc-heap
│   │  ├──20.77 MB (05.04%) ── decommitted-arenas
│   │  └───1.00 MB (00.24%) ++ (3 tiny)
│   └───1.47 MB (00.36%) ++ runtime
├───54.79 MB (13.28%) -- window-objects
│   ├──47.83 MB (11.60%) -- top(https://maps.google.com/?ie=UTF8&ll=49.759688,-85.184921&spn=0.021541,0.066047&t=v&z=15&vpsrc=6, id=7)
│   │  ├──47.24 MB (11.45%) -- active
│   │  │  ├──46.55 MB (11.29%) -- window(https://maps.google.com/?ie=UTF8&ll=49.759688,-85.184921&spn=0.021541,0.066047&t=v&z=15&vpsrc=6)
│   │  │  │  ├──44.20 MB (10.72%) -- js/compartment(https://maps.google.com/?ie=UTF8&ll=49.759688,-85.184921&spn=0.021541,0.066047&t=v&z=15&vpsrc=6)
│   │  │  │  │  ├──29.58 MB (07.17%) -- gc-heap
│   │  │  │  │  │  ├──18.29 MB (04.44%) ── unused-gc-things
│   │  │  │  │  │  ├───8.09 MB (01.96%) -- objects
│   │  │  │  │  │  │   ├──7.19 MB (01.74%) ── non-function
│   │  │  │  │  │  │   └──0.90 MB (00.22%) ── function
│   │  │  │  │  │  └───3.19 MB (00.77%) ++ (5 tiny)
│   │  │  │  │  ├───9.20 MB (02.23%) -- objects
│   │  │  │  │  │   ├──6.81 MB (01.65%) ── elements
│   │  │  │  │  │   └──2.39 MB (00.58%) ── slots
│   │  │  │  │  └───5.42 MB (01.31%) ++ (6 tiny)
│   │  │  │  └───2.35 MB (00.57%) ++ (4 tiny)
│   │  │  └───0.69 MB (00.17%) ++ (2 tiny)
│   │  └───0.59 MB (00.14%) ++ cached/window(about:home)
│   └───6.95 MB (01.69%) ++ (4 tiny)
├───15.42 MB (03.74%) ── heap-unclassified
├────5.06 MB (01.23%) -- storage
│    ├──5.06 MB (01.23%) ++ sqlite
│    └──0.00 MB (00.00%) ── prefixset/all
└────3.96 MB (00.96%) ++ (11 tiny)

Other Measurements
169 (100.0%) -- js-compartments
├──162 (95.86%) ── system
└────7 (04.14%) ── user

109.61 MB (100.0%) -- js-main-runtime
├───86.37 MB (78.80%) -- compartments
│   ├──42.23 MB (38.53%) -- gc-heap
│   │  ├──25.22 MB (23.01%) ── unused-gc-things
│   │  ├──10.01 MB (09.13%) -- objects
│   │  │  ├───7.91 MB (07.21%) ── non-function
│   │  │  └───2.10 MB (01.92%) ── function
│   │  ├───3.77 MB (03.44%) -- shapes
│   │  │   ├──1.68 MB (01.53%) ── tree
│   │  │   ├──1.25 MB (01.14%) ── dict
│   │  │   └──0.84 MB (00.77%) ── base
│   │  ├───1.66 MB (01.52%) ++ (4 tiny)
│   │  └───1.58 MB (01.44%) ── scripts
│   ├──22.19 MB (20.25%) ── string-chars
│   ├───9.96 MB (09.08%) -- objects
│   │   ├──6.82 MB (06.22%) ── elements
│   │   ├──3.11 MB (02.84%) ── slots
│   │   └──0.02 MB (00.02%) ── misc
│   ├───5.08 MB (04.63%) ── script-data
│   ├───3.15 MB (02.88%) ── analysis-temporary
│   ├───2.89 MB (02.63%) -- shapes-extra
│   │   ├──1.62 MB (01.48%) ++ (3 tiny)
│   │   └──1.26 MB (01.15%) ── dict-tables
│   └───0.87 MB (00.80%) ++ (3 tiny)
├───21.77 MB (19.86%) -- gc-heap
│   ├──20.77 MB (18.95%) ── decommitted-arenas
│   └───1.00 MB (00.91%) ++ (3 tiny)
└────1.47 MB (01.34%) ── runtime

43.23 MB (100.0%) -- js-main-runtime-gc-heap-committed
├──25.22 MB (58.33%) -- unused
│  ├──25.22 MB (58.33%) ── gc-things
│  └───0.00 MB (00.00%) ++ (2 tiny)
└──18.01 MB (41.67%) -- used
   ├──16.73 MB (38.70%) ── gc-things
   ├───1.00 MB (02.31%) ── chunk-admin
   └───0.28 MB (00.65%) ── arena-admin

0 (100.0%) -- low-memory-events
├──0 (100.0%) ── physical
└──0 (100.0%) ── virtual

6.60 MB (100.0%) -- window-objects
├──2.80 MB (42.47%) -- dom
│  ├──1.86 MB (28.23%) ── orphan-nodes
│  ├──0.44 MB (06.68%) ── element-nodes
│  ├──0.32 MB (04.85%) ── text-nodes
│  ├──0.18 MB (02.68%) ── other
│  └──0.00 MB (00.02%) ++ (2 tiny)
├──2.56 MB (38.80%) -- layout
│  ├──1.24 MB (18.71%) ── style-sets
│  ├──0.67 MB (10.19%) ── pres-shell
│  ├──0.31 MB (04.71%) ── frames
│  ├──0.13 MB (01.95%) ── style-contexts
│  ├──0.13 MB (01.91%) ── rule-nodes
│  └──0.09 MB (01.33%) ++ (3 tiny)
├──1.23 MB (18.67%) ── style-sheets
└──0.00 MB (00.06%) ── property-tables

   11.31 MB ── canvas-2d-pixel-bytes [2]
  412.45 MB ── explicit
    0.25 MB ── gfx-d2d-surfacecache
   13.31 MB ── gfx-d2d-surfacevram
   27.69 MB ── gfx-d2d-vram-drawtarget
    0.75 MB ── gfx-d2d-vram-sourcesurface
  251.63 MB ── gfx-surface-image
          0 ── ghost-windows
  347.32 MB ── heap-allocated
  366.45 MB ── heap-committed
   19.12 MB ── heap-committed-unused
      5.50% ── heap-committed-unused-ratio
    2.31 MB ── heap-dirty
   82.68 MB ── heap-unused
  249.16 MB ── images-content-used-uncompressed
   64.00 MB ── js-gc-heap
          0 ── low-commit-space-events
  683.22 MB ── private
  710.61 MB ── resident
    5.06 MB ── storage-sqlite
1,125.70 MB ── vsize
      1,424 ── webgl-buffer-count
    0.60 MB ── webgl-buffer-memory
          2 ── webgl-context-count
          1 ── webgl-renderbuffer-count
    5.13 MB ── webgl-renderbuffer-memory
         28 ── webgl-shader-count
      1,877 ── webgl-texture-count
  126.68 MB ── webgl-texture-memory
Now the really weird thing is that when I switched tabs to get the "about:memory", the memory usage of FF dropped down to around 600MB.  But if I switched back to the tab with Google Maps in it, the memory usage jumped back up to ~1.5GB.  That kept happening every time I switched tabs trying to get an accurate memory reading in about:memory.  Never seen that happen before.
Summary: [MemShrink] Google MapsGL Memory usage off the charts → Google MapsGL Memory usage off the charts
Whiteboard: [MemShrink]
This is almost certainly due to images, because

* The memory jumps up to 600mb when you switch back to the tab (at which point we'll decode all the images on the tab) and jumps down when you leave the tab (at which point we discard many of the tab's images).

* In the about:memory dump above, you're using very nearly 250mb of images

│  │  │  ├──249.16 MB (60.41%) ── uncompressed-heap

250mb is the default maximum amount of decoded image data we'll willingly keep around.  Sometimes we're forced to keep around more than that, but you're seeing here us hitting our max.

It's not entirely clear what Google is doing to cause us to have hundreds of mb of decoded images in the DOM, but we should wait and see if bug 689623 has an effect here.
Whiteboard: [MemShrink] → [MemShrink:P2]
(In reply to Justin Lebar [:jlebar] from comment #5)
> This is almost certainly due to images, because
> 
> * The memory jumps up to 600mb when you switch back to the tab (at which
> point we'll decode all the images on the tab) and jumps down when you leave
> the tab (at which point we discard many of the tab's images).
> 

No, the memory doesn't jump up to 600mb, it goes down after I switch from the Google tab.  When the Google Maps tab was in focus, the memory usage was around 1.5gb.  However, when I switched to the tab that had the about:memory in it (without closing the Google one), the memory went down to the 600mb.  I did happen to notice this at the bottom of my memory report above:
1,125.70 MB ── vsize
Seems all the images that Google loaded are really being stored in that as I can't get a good accurate about:memory with the Google tab in focus.
> 1,125.70 MB ── vsize

This isn't relevant; it's virtual memory which doesn't take up space in RAM.

> When the Google Maps tab was in focus, the memory usage was around 1.5gb.  However, when 
> I switched to the tab that had the about:memory in it (without closing the Google one), 
> the memory went down to the 600mb.

Okay, this is entirely consistent with images being the problem.

If you want to see this in action in about:memory, open a new browser window and load about:memory in there.
Mozilla/5.0 (Windows NT 6.2; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0

I can confirm that this is also happening on Win 8-64 bit with Firefox 16 beta 5. Used memory increased to 1,198.5MB.
Status: UNCONFIRMED → NEW
Ever confirmed: true
The content of my about:memory page is:
Main Process

Explicit Allocations
799.17 MB (100.0%) -- explicit
├──516.59 MB (64.64%) -- images
│  ├──516.27 MB (64.60%) -- content
│  │  ├──516.27 MB (64.60%) -- used
│  │  │  ├──498.59 MB (62.39%) ── uncompressed-heap
│  │  │  ├───17.68 MB (02.21%) ── raw
│  │  │  └────0.00 MB (00.00%) ── uncompressed-nonheap
│  │  └────0.00 MB (00.00%) ++ unused
│  └────0.32 MB (00.04%) ++ chrome
├──147.31 MB (18.43%) -- window-objects
│  ├──127.43 MB (15.94%) -- top(https://maps.google.com/maps?vector=1, id=8)
│  │  ├──126.94 MB (15.88%) -- active
│  │  │  ├──123.83 MB (15.49%) -- window(https://maps.google.com/maps?vector=1)
│  │  │  │  ├──120.94 MB (15.13%) -- js
│  │  │  │  │  ├──120.72 MB (15.11%) -- compartment(https://maps.google.com/maps?vector=1)
│  │  │  │  │  │  ├───56.88 MB (07.12%) -- gc-heap
│  │  │  │  │  │  │   ├──25.99 MB (03.25%) ── unused-gc-things [2]
│  │  │  │  │  │  │   ├──22.77 MB (02.85%) -- objects
│  │  │  │  │  │  │   │  ├──21.14 MB (02.65%) ── non-function [2]
│  │  │  │  │  │  │   │  └───1.62 MB (00.20%) ── function [2]
│  │  │  │  │  │  │   └───8.12 MB (01.02%) ++ (5 tiny)
│  │  │  │  │  │  ├───40.93 MB (05.12%) -- objects
│  │  │  │  │  │  │   ├──36.54 MB (04.57%) ── elements [2]
│  │  │  │  │  │  │   └───4.40 MB (00.55%) ++ (2 tiny)
│  │  │  │  │  │  ├───14.02 MB (01.75%) ++ (7 tiny)
│  │  │  │  │  │  └────8.89 MB (01.11%) ── analysis-temporary [2]
│  │  │  │  │  └────0.22 MB (00.03%) ++ compartment(https://maps.google.com/maps?vector=1, about:blank)
│  │  │  │  └────2.89 MB (00.36%) ++ (4 tiny)
│  │  │  └────3.12 MB (00.39%) ++ (4 tiny)
│  │  └────0.48 MB (00.06%) ++ cached/window([system])
│  └───19.88 MB (02.49%) ++ (8 tiny)
├───71.04 MB (08.89%) -- js-non-window
│   ├──48.92 MB (06.12%) -- compartments
│   │  ├──33.37 MB (04.18%) ++ non-window-global
│   │  └──15.55 MB (01.95%) -- no-global/compartment(atoms)
│   │     ├──14.34 MB (01.79%) ── string-chars
│   │     └───1.21 MB (00.15%) ++ (2 tiny)
│   ├──16.10 MB (02.01%) -- gc-heap
│   │  ├──14.49 MB (01.81%) ── decommitted-arenas
│   │  └───1.61 MB (00.20%) ++ (3 tiny)
│   └───6.02 MB (00.75%) ++ runtime
├───50.56 MB (06.33%) ── heap-unclassified
└───13.67 MB (01.71%) ++ (13 tiny)

Other Measurements
313 (100.0%) -- js-compartments
├──299 (95.53%) ── system
└───14 (04.47%) ── user

210.07 MB (100.0%) -- js-main-runtime
├──187.95 MB (89.47%) -- compartments
│  ├───86.90 MB (41.37%) -- gc-heap
│  │   ├──39.94 MB (19.01%) ── unused-gc-things
│  │   ├──30.11 MB (14.33%) -- objects
│  │   │  ├──25.38 MB (12.08%) ── non-function
│  │   │  └───4.73 MB (02.25%) ── function
│  │   ├───7.91 MB (03.77%) -- shapes
│  │   │   ├──3.69 MB (01.76%) ── tree
│  │   │   ├──2.51 MB (01.20%) ── dict
│  │   │   └──1.71 MB (00.81%) ── base
│  │   ├───4.13 MB (01.97%) ── strings
│  │   ├───3.30 MB (01.57%) ── scripts
│  │   └───1.51 MB (00.72%) ++ (3 tiny)
│  ├───42.79 MB (20.37%) -- objects
│  │   ├──36.67 MB (17.45%) ── elements
│  │   ├───5.99 MB (02.85%) ── slots
│  │   └───0.14 MB (00.06%) ── misc
│  ├───18.58 MB (08.85%) ── string-chars
│  ├───18.33 MB (08.73%) ── analysis-temporary
│  ├───11.21 MB (05.34%) ── script-data
│  ├────5.88 MB (02.80%) ++ shapes-extra
│  ├────2.53 MB (01.21%) ++ type-inference
│  └────1.72 MB (00.82%) ++ (2 tiny)
├───16.10 MB (07.66%) -- gc-heap
│   ├──14.49 MB (06.90%) ── decommitted-arenas
│   └───1.61 MB (00.77%) ++ (3 tiny)
└────6.02 MB (02.87%) ── runtime

88.51 MB (100.0%) -- js-main-runtime-gc-heap-committed
├──48.57 MB (54.88%) -- used
│  ├──46.41 MB (52.43%) ── gc-things
│  ├───1.61 MB (01.82%) ── chunk-admin
│  └───0.56 MB (00.63%) ── arena-admin
└──39.94 MB (45.12%) -- unused
   ├──39.94 MB (45.12%) ── gc-things
   └───0.00 MB (00.00%) ++ (2 tiny)

0 (100.0%) -- low-memory-events
├──0 (100.0%) ── physical
└──0 (100.0%) ── virtual

8.28 MB (100.0%) -- window-objects
├──3.67 MB (44.34%) -- layout
│  ├──1.83 MB (22.07%) ── style-sets
│  ├──0.97 MB (11.76%) ── pres-shell
│  ├──0.35 MB (04.27%) ── frames
│  ├──0.19 MB (02.35%) ── rule-nodes
│  ├──0.18 MB (02.12%) ── style-contexts
│  ├──0.10 MB (01.15%) ── pres-contexts
│  └──0.05 MB (00.62%) ++ (2 tiny)
├──2.65 MB (32.07%) ── style-sheets
├──1.94 MB (23.43%) -- dom
│  ├──0.88 MB (10.59%) ── element-nodes
│  ├──0.47 MB (05.62%) ── text-nodes
│  ├──0.36 MB (04.37%) ── other
│  ├──0.24 MB (02.84%) ── orphan-nodes
│  └──0.00 MB (00.01%) ++ (2 tiny)
└──0.01 MB (00.16%) ── property-tables

   28.56 MB ── canvas-2d-pixel-bytes [2]
  799.12 MB ── explicit
    7.42 MB ── gfx-d2d-surfacecache
   49.79 MB ── gfx-d2d-surfacevram
   24.56 MB ── gfx-d2d-vram-drawtarget
    0.00 MB ── gfx-d2d-vram-sourcesurface
  505.41 MB ── gfx-surface-image
          0 ── ghost-windows
  690.50 MB ── heap-allocated
  705.65 MB ── heap-committed
   15.14 MB ── heap-committed-unused
      2.19% ── heap-committed-unused-ratio
    1.51 MB ── heap-dirty
  107.50 MB ── heap-unused
  498.59 MB ── images-content-used-uncompressed
  103.00 MB ── js-gc-heap
          0 ── low-commit-space-events
1,143.09 MB ── private
1,115.07 MB ── resident
    6.13 MB ── storage-sqlite
1,658.92 MB ── vsize
      4,659 ── webgl-buffer-count
   11.38 MB ── webgl-buffer-memory
          4 ── webgl-context-count
          1 ── webgl-renderbuffer-count
    4.07 MB ── webgl-renderbuffer-memory
         68 ── webgl-shader-count
      2,377 ── webgl-texture-count
  143.12 MB ── webgl-texture-memory
Bug 689623 has landed.  Has that improved matters?

If I should file a new bug, I can, but I think I see very similar issues with google maps today, on Linux X11.

Of note, my observations are that it is slow but predictable without any interactions needed. If I leave a google maps instance open (not even focused) for any length of time, a persistent memory leak appears, and can easily suck up 8G, then swapout and nerf my computer in the span of ~30 minutes.

My STR: Open maps.google.com and wait. Been a thing for over 2 years for me.

Severity: normal → S3

2 years later and some interaction is required. Most browsing around maps is safe, but any usage of directions triggers this

When this happens enough to trigger the bug but not crash the computer, I see logs like:

WebGL(0x7fbef0712200)::LoseContext(0)
WebGL(0x7fbfe0cafd00)::LoseContext(0)
WebGL(0x7fbf15de4100)::LoseContext(0)
WebGL(0x7fbf69af0600)::LoseContext(0)
WebGL(0x7fbf876a0100)::LoseContext(0)
WebGL(0x7fbef02e3d00)::LoseContext(0)
WebGL(0x7fbef02e3600)::LoseContext(0)
WebGL(0x7fbf0c9d1d00)::LoseContext(0)
WebGL(0x7fbf56188200)::LoseContext(0)
WebGL(0x7fbfe8e2e800)::LoseContext(0)
WebGL(0x7fbf0c9d1600)::LoseContext(0)
WebGL(0x7fbf033f6f00)::LoseContext(0)
WebGL(0x7fbf5fcfb400)::LoseContext(0)
WebGL(0x7fbeedaf7f00)::LoseContext(0)
WebGL(0x7fbeedaf7800)::LoseContext(0)
WebGL(0x7fbfc96dc100)::LoseContext(0)
WebGL(0x7fbeed061f00)::LoseContext(0)
WebGL(0x7fbeed063400)::LoseContext(0)
WebGL(0x7fbf305edb00)::LoseContext(0)

You need to log in before you can comment on or make changes to this bug.