Closed Bug 1643560 Opened 4 years ago Closed 11 months ago

High memory usage on Facebook

Categories

(Core :: JavaScript Engine, defect, P2)

76 Branch
defect

Tracking

()

RESOLVED INCOMPLETE
Performance Impact medium

People

(Reporter: dcarter, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf:resource-use)

Attachments

(8 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

I keep three tabs open at all times: facebook.com; youtube.com; twitter.com

Within a couple hours of use, the system fails to respond. This is happening on multiple platforms (MacOS, Ubuntu 18.04)

Actual results:

Updates become impossible. Images fail to load. System crawls due to lack of resources. This problem seems to get worse with each successive release.

Expected results:

Pages should load as normal (as they used to up until a couple of months ago)

I started noticing performance issues a few months ago (can't remember exactly when) on multiple platforms.

My primary browsing machine is a standard MacBook Air:
Model Name: MacBook Air
Model Identifier: MacBookAir7,2
Processor Name: Dual-Core Intel Core i5
Processor Speed: 1.6 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Hyper-Threading Technology: Enabled
Memory: 4 GB

My secondary platform is an 8 core Opteron, 12 GB memory, Ubuntu 18.04

Facebook is the first to fail. Updates start but never complete. Images stop loading. If I close the tab and open a new one it acts like there was never a problem. The other pages take longer to exhibit symptoms, but eventually they all do. Again, closing the tab and creating a new one usually fixes it. It's worse when I reselect the tab after I've been in a different tab for a while. Sometimes, it is better to just restart the program.

Reducing the number of content processes from the default 8 to 4 buys me some time, but not much.

This is now the single biggest resource hog on all of my systems. I can't run anything else and firefox at the same time, and it seems to be getting worse with each successive release

Noticed the same on

  • Windows 10 2004
  • Ryzen 5 1600
  • 16 GB DDR4 3000 MHz RAM
  • GTX 1660 Ti

Right after Firefox launches, it takes about 2 GB RAM and everything works smoothly. Then, I open a couple of Reddit tabs, play a YouTube video, visit Facebook, and even after I close all those tabs, memory usage is at about 10 GB. I have to wait for every action to happen. Even now, I type this text in mostly blind, and wait until the content of the texbox catches up to what I wrote.

True, I do have 800 tabs open, but I never had those issues even at my peak of 2500 tabs.

David, thanks for taking the time to report this. Could you please take a memory report from about:memory? Here are the steps you need to take to get the memory report:

  1. Wait until Firefox is consuming a large amount of memory
  2. Enter about:memory in the URL bar and press enter
  3. Click "Measure and save" (optionally with "anonymize" checked to hide URLs, although this will likely make it more difficult for us to figure out which site, if any, is causing the leak)
  4. Save the memory report somewhere
  5. Attach the report to this bug.
Flags: needinfo?(dcarter)
Attached file memory-report1.json.gz
Flags: needinfo?(dcarter)
Attached file memory-report2.json.gz
Attached file memory-report3.json.gz

I've attached 3 files showing increasing memory usage over the course of a morning with 3 tabs open, facebook, youtube, and twitter. By the time of the third snapshot, I had to restart the browser

Andrew, when time allows, could you please have a look over these memory reports? Thanks!

Flags: needinfo?(continuation)

The main thing I can see going wrong is that Facebook is using more and more memory. The process with Facebook doesn't even show up in the third report, presumably because the process took too long to respond. It is up to 3.2GB by the second report.

There's 383MB of just strings. Lots of stuff like "3508390505862552{"RELAY_INCREMENTAL_DELIVERY":true,"UFI2CommentsProv". I'm not sure what that means. There's about a gig of JS classes.

It looks like the Adobe Acrobat extension has a content script for Facebook. I don't know if that could be causing the memory to rise somehow. You could try disabling that and see if it helps.

Flags: needinfo?(continuation)
Summary: Firefox performance degraded to the point of being unusable → High memory usage on Facebook
Attached file memory-report4.json.gz
Attached file memory-report5.json.gz
Attached file memory-report6.json.gz

Attached 3 new files, again showing memory increasing with the Adobe plugin disabled. It was slower, but still a problem. This one spanned 10-12 hours instead of 4, and wasn't quite at the same level. It was having issue playing videos, one of the symptoms that tells me it's time to restart.

Attached image processes.png

I have the same problem. Memory increases linearly and the program (Firefox 81.0) becomes unresponsive

The memory usage doesn't look super high in the about:memory report in comment 15. Did you do "Minimize memory usage" or anything like that before you got the memory report? One thing I did notice in the facebook process is that there's a ton of fragmentation. Almost 80MB of unused-gc-things, about 60MB of bin-unused. That could happen if there was a lot of memory being used, but then it was freed.

Yes, I did it. I tried to take control of the program, because in this situation I can't take change a tab, everything is run very slow. The problem only affects when the card with fb.com is opened. I disabled all extensions, but problem still exist. The only solution I know is terminate FF. By the way.. I was totally surprised when about:memory showed me an xml parsing error.

I suspect that this is a matter of configuring the drivers and hardware in one of the laptops, because on another laptop this problem will not occur with the same version of system, extensions and FF.

See Also: → 1674295

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Performance
Product: Firefox → Core

Can this be closed as having the same root cause as Bug 1674295?

Component: Performance → JavaScript Engine
Whiteboard: [qf:p2:resource]
Severity: -- → S3
Priority: -- → P2

triaging

:sdetar as mentioned in comment #20 Can this be closed as having the same root cause as Bug 1674295?

Flags: needinfo?(sdetar)

:nbp, do you have thoughts if this can be closed as mentioned in comment #20?

Flags: needinfo?(sdetar) → needinfo?(nicolas.b.pierron)

(In reply to Kim Moir [:kmoir] ET from comment #21)

:sdetar as mentioned in comment #20 Can this be closed as having the same root cause as Bug 1674295?

Bug 1674295 root cause is related to the fact that ffmpeg is installed or not on the computer, and specific to Linux.
At least this is the only way known to reproduce it.

I do not see anything here suggesting that installing ffmepg remove the problem.

Flags: needinfo?(nicolas.b.pierron)
Performance Impact: --- → P2
Whiteboard: [qf:p2:resource]

This hasn't had any movement in years. Firefox and Facebook have changed a lot in that time, so if anybody is continuing to experience issues with Facebook, please file a new bug.

Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: