High image memory consumption and sluggishness (esp. with hwaccel?) caused by Firefusk and/or CL Pics add-ons

RESOLVED WORKSFORME

Status

()

Core
Graphics
--
major
RESOLVED WORKSFORME
6 years ago
4 years ago

People

(Reporter: geeknik, Unassigned)

Tracking

Trunk
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Snappy:P3][MemShrink:P3])

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
When the 64-bit Nightly builds hit 1.5GB of RAM usage or higher, the performance of the entire browser is extremely poor. I have 24GB of DDR3 in this 64-bit Windows 7 Pro machine, so I don't care about the high memory usage, however, I do care about the poor performance. (Opening this bug per dietrich in Bug #675539).

Hardware:
Gigabyte X58A-UD7 motherboard
Intel Core i7-920 2.66ghz (4 cores, 8 threads)
24GB DDR3 PC3-10666
GeForce GTX 570 w/ 1280MB RAM
C: 240GB OWC 6G SSD
D: 4x1TB Samsung Sata Drives in RAID10

All software is loaded off the RAID10, Win7 boots off of the SSD.

Hardware acceleration is on, DirectWrite is on, etc. All for everything on my system are the latest versions.

Browser Plugins:
Flash 11.2.202.18
Java Deployment Toolkit 7.0.10.8
Java(TM) Platform SE 7 U1

Extensions:
about:telemetry v0.6
Adblock Plus v1.3.11a.3210
Adblock Plus Popup Addon v0.2.9
Add-on Compatibility Reporter v0.9.3
BetterPrivacy v1.49
Bugzilla Tweaks v1.11.3
CL Pics v0.7.20110116
Element Hiding Helper for Adblock Plus v1.1.3a.342
firefusk v1.9
Greasemonkey 2011.09.27.nightly
HashColouredTabs+ v0.4.28
Iconic Firefox Menu v1.2
Imgur Uploader v1.0.3
LastPass v1.80.0
Nuke Anything Enhanced v1.0.2
Open Image in New Tab v1.1
PriceBlink v2.1
Readability v2.0
Reddit Enhancement Suite v4.0.1
Restartless Restart v8
StumbleUpon v3.97
Stylish v1.2.4
(Reporter)

Comment 1

6 years ago
*All drivers for everything in my system are the latest versions. Sorry, I thought I proofread this better.

Comment 2

6 years ago
An inconvenient truth!!!! 1gb or more and browser turn the worse one!!

For what you need a modern system with 16gb of ram or more if Firefox is so bad above 1gb.

And for sure, this bug will be closed with "not resolved fixed".

Comment 3

6 years ago
TinyButStrong: Please try to stay technical. This also means: Assume people mean well and are volunteers. Also see https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

Comment 4

6 years ago
(In reply to Brian Carpenter [:geeknik] from comment #1)
> *All drivers for everything in my system are the latest versions. Sorry, I
> thought I proofread this better.

have you tried turning d2d off
(Reporter)

Comment 5

6 years ago
(In reply to Taras Glek (:taras) from comment #4)
> 
> have you tried turning d2d off

No, but I'll turn off hardware acceleration now and see how it runs the rest of the day.
(Reporter)

Comment 6

6 years ago
Interesting, I didn't even have to go the rest of the day to see a difference. Hardware acceleration is off and I have the same high # of tabs as before and the RAM usage is ~1GB instead of 1.5-1.8GB.

Updated

6 years ago
Component: General → Graphics
Product: Firefox → Core
QA Contact: general → thebes
Whiteboard: [Snappy]

Comment 7

6 years ago
Jeff, we need a way to detect when hw accel is going sour(and disable it). It's bad when drivers destroy ff perf like this.

Updated

6 years ago
Whiteboard: [Snappy] → [Snappy][memshrink]
Our GPU memory reporter might help us figure out what's going on here. I don't think we can have a good way of detecting sourness without a better picture of what's actually going wrong. My guess is that we're perhaps thrashing video memory.
Depends on: 689870
(In reply to Brian Carpenter [:geeknik] from comment #6)
> Interesting, I didn't even have to go the rest of the day to see a
> difference. Hardware acceleration is off and I have the same high # of tabs
> as before and the RAM usage is ~1GB instead of 1.5-1.8GB.

1GB is still very high. It shouldn't really get that high without HW accel either.

Depending on what is using that RAM hardware acceleration could cause a considerable increase of that memory. about:memory should be able to tell you more though. If there's a very large amount of memory being used by images, we actually keep images twice with hardware acceleration because we keep the software memory copy around (Azure will help greatly here eliminating this need largely).
(Reporter)

Comment 10

6 years ago
Created attachment 586608 [details]
about:memory?verbose

I turned hw accel back on, I have 8 pinnned tabs and this bugzilla tab open and this is the about:memory?verbose. I did hit the minimize memory usage button before I saved all the info, but I see some zombies in there, like Reddit and Twitter and Imgur.
You can also take a look at the amount of GPU memory used using Process Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653
(Reporter)

Comment 12

6 years ago
(In reply to Jeff Muizelaar [:jrmuizel] from comment #11)
> You can also take a look at the amount of GPU memory used using Process
> Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653

Process Explorer reports the following:

GPU 1.5% 
GPU System Bytes 7,208K
GPU Dedicated Bytes 85,824K
GUP Committed Bytes 52,084K
(In reply to Brian Carpenter [:geeknik] from comment #12)
> (In reply to Jeff Muizelaar [:jrmuizel] from comment #11)
> > You can also take a look at the amount of GPU memory used using Process
> > Explorer: http://technet.microsoft.com/en-us/sysinternals/bb896653
> 
> Process Explorer reports the following:
> 
> GPU 1.5% 
> GPU System Bytes 7,208K
> GPU Dedicated Bytes 85,824K
> GUP Committed Bytes 52,084K

That's not much.

Can you quantify the performance change from good to bad. For example, how does your FishIE frame rate change? Does it get bad all of a sudden or does it gradually get worse as the memory usage goes up?
(Reporter)

Comment 14

6 years ago
Nightly is fine when it first starts up and I only have the 8 pinned tabs and 1 or 2 others. However, when I'm going through my readitlater list and I'm opening 10 new tabs every 10-15 minutes, things start going downhill really fast. Normally after going through 50 tabs like this, I'm up to about 1.6GB to 1.8GB of RAM usage and I have to restart Nightly (which takes anywhere from 30-600 seconds) and pegs 1 CPU core at 100% usage in the process. The reason for restarting Nightly is because pages quit scrolling, the browser quits responding, switching to other tabs takes longer, opening new tabs takes longer, etc. So I guess it just gradually gets worse over time. Like I said in the 1st post, I don't care if Firefox uses 10GB of RAM on this machine, I just want it to perform the same way at 10GB of RAM that it performs at 250MB of RAM. That is probably hoping for too much, but cpu/ram/video/disk is definitely not a bottleneck here. =)
Hrm, 500 MB of JS reported on the top, 790 GB if I add the numbers in the bottom. Does the bottom part contain some duplication? In any case, the amount of memory JS uses is pretty amazingly high.

But for the graphics part the differents HW accel on/off is pretty interesting. All the extra memory usage seems to be solely reported in the V size from what I can see. I really wonder why it's that big with the GPU or anything else not really using any of that memory from what we can see. It -could- be the driver I guess, doing something funky in the background. But I'd be surprised, that's a gaming card which should be able to handle higher pressure than we put on it.

What's your graphics section from about:support? Just for the record.
(In reply to Brian Carpenter [:geeknik] from comment #14)
> Like I said in the 1st post, I don't care if Firefox uses 10GB of RAM
> on this machine, I just want it to perform the same way at 10GB of RAM that
> it performs at 250MB of RAM. That is probably hoping for too much, but
> cpu/ram/video/disk is definitely not a bottleneck here. =)

Heh :) We only have 2 GB of address space, when we near that, it would most certainly become problematic, no way to use your 10 GB of RAM :( But really, we -shouldn't- be using 1.8GB anyway! I'm surprised it doesn't crash.
(Reporter)

Comment 17

6 years ago
I can regularly make Nightly use 6GB-8GB of RAM with no problems other than it is slower than molasses in the winter. ;)

FYI, I just tested https://ie.microsoft.com/testdrive/Performance/FishBowl/:
1122MB of RAM w/ 2000 fish = 25 FPS
258MB of RAM w/ 2000 fish = 25 FPS

about:support info

Graphics

Adapter Description NVIDIA GeForce GTX 570
Vendor ID 0x10de
Device ID0x1081
Adapter RAM 1280
Adapter Drivers nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um
Driver Version 8.17.12.9053
Driver Date 12-17-2011
Direct2D Enabled true
DirectWrite Enabled true (6.1.7601.17563)
ClearType Parameters DISPLAY1 [ Gamma: 2200 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 100 ] DISPLAY2 [ Gamma: 2200 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 200 ] 
WebGL RendererGoogle Inc. -- ANGLE (NVIDIA GeForce GTX 570) -- OpenGL ES 2.0 (ANGLE 1.0.0.930)
GPU Accelerated Windows 1/1 Direct3D 10
AzureBackend direct2d
(Reporter)

Comment 18

6 years ago
These screen shots were taken before Christmas on this very same machine:

http://i.imgur.com/Ia6r8.png
http://i.imgur.com/bvK16.png

Pretty insane numbers. And this was with just a couple of tabs.
(In reply to Brian Carpenter [:geeknik] from comment #18)
> These screen shots were taken before Christmas on this very same machine:
> 
> http://i.imgur.com/Ia6r8.png
> http://i.imgur.com/bvK16.png
> 
> Pretty insane numbers. And this was with just a couple of tabs.

5500 MB of images??

This is a 64-bit nightly then?
(Reporter)

Comment 20

6 years ago
(In reply to Bas Schouten (:bas) from comment #19)
> 5500 MB of images??
> 
> This is a 64-bit nightly then?

Yes, it was around 1000 images all in 1 tab. And yes, 64-bit Nightly.
(In reply to Brian Carpenter [:geeknik] from comment #17)
> I can regularly make Nightly use 6GB-8GB of RAM with no problems other than
> it is slower than molasses in the winter. ;)
> 
> FYI, I just tested https://ie.microsoft.com/testdrive/Performance/FishBowl/:
> 1122MB of RAM w/ 2000 fish = 25 FPS
> 258MB of RAM w/ 2000 fish = 25 FPS

That suggests that the performance of fishie isn't any worse. Can you come up with something measurable that does get worse?

Comment 22

6 years ago
When i had d2d problems. Entering/leaving private mode was measurably slow. Perhaps Brian's chrome is drawing slowly too.

Holding on ctrl+tab also animated horribly slowly.

Brian try those with/without accel.

Comment 23

6 years ago
(In reply to Brian Carpenter [:geeknik] from comment #14)
> Nightly is fine when it first starts up and I only have the 8 pinned tabs
> and 1 or 2 others. However, when I'm going through my readitlater list and
> I'm opening 10 new tabs every 10-15 minutes, things start going downhill
> really fast. Normally after going through 50 tabs like this, I'm up to about
> 1.6GB to 1.8GB of RAM usage and I have to restart Nightly (which takes
> anywhere from 30-600 seconds) and pegs 1 CPU core at 100% usage in the
> process. The reason for restarting Nightly is because pages quit scrolling,
> the browser quits responding, switching to other tabs takes longer, opening
> new tabs takes longer, etc. So I guess it just gradually gets worse over
> time. Like I said in the 1st post, I don't care if Firefox uses 10GB of RAM
> on this machine, I just want it to perform the same way at 10GB of RAM that
> it performs at 250MB of RAM. That is probably hoping for too much, but
> cpu/ram/video/disk is definitely not a bottleneck here. =)

I can second all noted here. My situation is exactly the same, with exactly the same symptoms (slow performance after opening/closing many tabs, slow restarts with one core maxed out).
Having an idea of GC/CC times could be useful. Can be seen by turning on javascript.options.mem.log in about:config and viewing the error console.

This is a more general question which could be tested. Could this be related to javascript.options.mem.high_water_mark being set to 128? I assume this means it triggers GC/CC more often when a compartment is using more than 128MB js memory and in the case of attachment 586608 [details] the main [System Principal] is just over that.
(Reporter)

Comment 25

6 years ago
(In reply to Hugh Nougher [:Hughman] from comment #24)
> Having an idea of GC/CC times could be useful. Can be seen by turning on
> javascript.options.mem.log in about:config and viewing the error console.


At 250-300MB of RAM usage, the GC/CC lines show 40-50ms. At 800-900MB of RAM usage, the GC/CC lines show 215-250ms. At 1200MB of RAM usage, the GC/CC lines show 270-300ms.
It sounds like one or more or your add-ons is acting up.

Does Firefox work well when you disable all of your add-ons?
Summary: Poor performance during high RAM usage in Windows 64-bit Nightly builds → Poor performance during high RAM usage in Windows 64-bit Nightly builds (many add-ons)
Whiteboard: [Snappy][memshrink] → [Snappy][MemShrink]
(In reply to Bas Schouten (:bas) from comment #9)
> 
> 1GB is still very high. It shouldn't really get that high without HW accel
> either.

Why not?  1GB isn't that unusual for many workloads.


(In reply to Bas Schouten (:bas) from comment #15)
> Hrm, 500 MB of JS reported on the top, 790 GB if I add the numbers in the
> bottom. Does the bottom part contain some duplication? In any case, the
> amount of memory JS uses is pretty amazingly high.

The measurements in the "Other measurements" list cross-cut the ones in the "Explicit Allocations" tree, so JS is using 509MB.  Again, that's far from exceptional, depending on the workload.


This bug is in danger of spinning out of control.  There are at least two different issues to investigate.

- The hardware acceleration/driver issue:  comment 6 and comment 7.

- Separate from that:  you have 22 add-ons installed, when someone has that many add-ons installed and have high memory usage or bad performance, there's a very good chance that one or more of the add-ons are at fault.  Brian, can you try Firefox in safe mode (http://support.mozilla.org/en-US/kb/Safe%20Mode) which disables all add-ons, and see if the problem still occurs?  If it does, we know it's a Firefox problem, otherwise we know it's an add-on problem.  If it's the latter case, if you could try selectively disabling add-ons to identify the particular add-on(s) that would be great.  (AdBlock Plus Popup Add-on v0.2.9 is known to cause leaks, for example -- bug 711778.)

Once we know whether add-ons are causing some/all of the problems, we should split this bug into two or more.
Summary: Poor performance during high RAM usage in Windows 64-bit Nightly builds (many add-ons) → Poor performance during high RAM usage in Windows 64-bit Nightly builds (many add-ons) (hwaccel problems?)
(In reply to rinoshea from comment #23)
> 
> I can second all noted here. My situation is exactly the same, with exactly
> the same symptoms (slow performance after opening/closing many tabs, slow
> restarts with one core maxed out).

rinoshea:  can you please file a separate bug for your issues?  When someone has generic high memory/high cpu/slow symptoms, it generally keeps things much less confusing if other people don't pile onto the same bug report, because the causes can be very dependent on the particular configuration (graphics drivers, add-ons installed, etc).  So I'd like to keep this bug report about Brian's problems.  Thanks!
(Reporter)

Comment 29

6 years ago
The extensions that I originally listed is outdated, so here is an updated list:

about:telemetry 0.9.1
Adblock Plus 2.0.4a.3398
Adblock Plus Pop-up Addon 0.3
BetterPrivacy 1.67
Bugzilla Tweaks 1.11.3
CL Pics 0.8.0
Element Hiding Helper for Adblock Plus 1.2a.368
F1 by Mozilla Labs 0.8.3
firefusk 1.91
Greasemonkey 2012.01.09.nightly
HTTPS-Everywhere 2.0development.4
Iconic Firefox Menu 1.2
IdentFavIcon 0.3.4.6
Imgur Uploader 1.0.3
LastPass 1.80.0
Memory Restart 1.8
Old Default Image Style 1.0
Open Image In New Tab 1.1
OpenDownload² 3.2.1
Reddit Enhancement Suite 4.0.3
Social Fixer 6.221
StumbleUpon 3.99
Stylish 1.2.4

Ads far as running in safe mode, sure the browser runs fine. But in a state w/o at least a few of the extensions, it's not usuable to me and I'd just as soon go fire up IE9. Like I keep saying, I don't care if Firefox/Nightly uses 10GB of RAM. It shouldn't start performing terribly when it does so. I have 24GB of RAM in this machine, 18GB of which is available right now. RAM is not the problem, performance is. =)

Comment 30

6 years ago
So the gfx problem is not present unless extensions are enabled? Wonder how extensions could interact with gfx.
> Ads far as running in safe mode, sure the browser runs fine. But in a state w/o at least a few of 
> the extensions, it's not usuable to me and I'd just as soon go fire up IE9. Like I keep saying, I 
> don't care if Firefox/Nightly uses 10GB of RAM. It shouldn't start performing terribly when it 
> does so.

I think the fallacy here may be the assumption that the events A="Firefox uses a lot of memory" and B="Firefox runs slowly" are related as A causes B.  We know that A and B are correlated, but it could well be that something else, C, causes both A and B.

To be concrete, the problem isn't necessarily that these add-ons take up lots of memory and then cause perf issues because Firefox somehow can't handle that much memory being used.  The add-ons could be both taking up lots of memory and causing their own perf issues.  In fact, that's almost certainly what's going on.

> Wonder how extensions could interact with gfx.

If the add-on keeps images pinned in memory, they might stay pinned in gfx memory...  That's kind of what it looks like is happening from about:memory.
(Reporter)

Comment 32

6 years ago
I'll turn off everything except AdBlock Plus, StumbleUpon, LastPass and RES and see how the browser acts after a normal day of abuse from me.
It might be useful, if Firefox still doesn't perform well with only those extensions, to try to isolate which extension is the culprit.  We've done a lot of testing with Adblock Plus, but not those other extensions.

(For example, LastPass used to leak every page you touched, but now it apparently only leaks at most one page; bug 674535.  At the rate we've found leaks, chances are pretty good that at least one of StumbleUpon or RES also has a leak.  Not to imply that memory leaks <==> performance problems!  :)
(Reporter)

Comment 34

6 years ago
Yeah, I planned on further isolation if necessary. Just can't get through my day w/o at least having these extensions turned on. =)
We've had measured success getting memory and performance issues in add-ons fixed.  So if you can isolate the problem, we can file a bug and get the add-on developer looped in.

Just to be clear, even if Firefox itself doesn't have a bug, you still see an issue which someone needs to fix.

Comment 36

6 years ago
(In reply to Justin Lebar [:jlebar] from comment #31)
 > Wonder how extensions could interact with gfx.
> 
> If the add-on keeps images pinned in memory, they might stay pinned in gfx
> memory...  That's kind of what it looks like is happening from about:memory.

I am worried that we do not have any telemetry infrastructure to catch gfx-accel regressions like this. Optimally we should turn off gfx accel if things go slower with it than without.
> As far as running in safe mode, sure the browser runs fine. But in a state
> w/o at least a few of the extensions, it's not usuable to me and I'd just as
> soon go fire up IE9.

jlebar has kind of addressed this point, but in case it wasn't clear: we're not suggesting disabling add-ons as a long-term solution to your problems.  We're suggesting it as the first step towards isolating the cause of the problem.  

The fact that safe mode runs fine has told us that it's one or more add-ons that's causing the problem.  Now we just needs to work out which one!   Unfortunately, when there are lots of add-ons involved this isn't easy.
(Reporter)

Comment 38

6 years ago
Ok. Back to report. I enabled a bunch of extensions, I have hwaccel enabled, and performance is better.  Windows Task Manager currently reports 1,053,888K Private Working Set, Commit Size 1,073,548K and a Peak Working Set of 1,355,872K. I haven't had to restart the browser due to sluggish performance or not responding, etc. I will also note that I dropped javascript.options.mem.high_water_mark from 128 to 64 a couple of days ago. 

Extensions that are currently disabled:

CL Pics 0.8.0
Firefusk 1.91
Imgur Uploader 1.0.3
YouTube Comment Snob 1.5.1
YTShowRating 1.0.4

The last 3 of these quit working around the time Nightly's version went from 11 to 12 but I kept them enabled in the hopes they would get updated.
So it sounds like Firefusk or CL Pics is the cause.  Can you re-enable them one at a time to determine which one is the culprit (or maybe they both are).  Thanks, Brian, this is very helpful!
(Reporter)

Comment 40

6 years ago
They both are probably the culprit here, keeping images in memory forever and not releasing them. Firefusk hasn't been updated since May '11 and CL Pics hasn't been updated since July '11. Just because an old extension works, doesn't mean it is going to play nice with the browser. =)
Summary: Poor performance during high RAM usage in Windows 64-bit Nightly builds (many add-ons) (hwaccel problems?) → High image memory consumption and sluggishness (esp. with hwaccel?) caused by Firefusk and/or CL Pics add-ons
Whiteboard: [Snappy][MemShrink] → [Snappy][MemShrink:P3]
(Reporter)

Comment 41

6 years ago
I've created a new profile and used sync to import everything, preferences, history, bookmarks, extensions, etc.

I have the following extensions installed and enabled:

about:telemetry 0.9.1
Adblock Plus 2.0.3
Adblock Plus Pop-up Addon 0.3
BetterPrivacy 1.68
Bugzilla Tweaks 1.11.3
Element Hiding Helper 1.1.4
firefusk 1.91
Google Search link fix 1.3
Greasemonky 0.9.15
Iconic Firefox Menu 1.2
LastPasss 1.80.0
Memory Restart 1.8
Old Default Image Style 1.0
Open Image in New Tab 1.1
OpenDownload² 3.2.1
Shareaholic 3.0.1
StumbleUpon 3.99
YTShowRating 1.0.4

I have the following plugins installed and enabled:

Shockwave Flash 11.2 r202 (64-bit)
Java(TM) Platform SE 7 U1 (64-bit)

Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:12.0a1) Gecko/20120126 Firefox/12.0a1 w/ hardware accel enabled (direct write font rendering is off).

Memory usage with 5 pinned tabs and 3 open tabs including about:support is 410MB private working set, 435MB commit size and 529MB peak working set. I will report back in another day or two after I abuse the new profile and see how it performs.
(Reporter)

Comment 42

6 years ago
Haven't broke the 1GB barrier yet in memory usage. Creating the new profile seems to have solved my problems at least. After using Nightly for the last 2 hours or so, I'm only up to 635MB private working set. I supposed I could zip up the old profile and make it available to Mozilla for research if anyone thinks there might be clues in it. I've even added in a few more extensions (Social Fixer, Reddit Enhancement Suite and Ghostery) and everything is pretty snappy.

Comment 43

6 years ago
you could compare your old prefs.js, that's the only major difference between old/new profiles i can think of in your case.

Updated

6 years ago
Whiteboard: [Snappy][MemShrink:P3] → [Snappy:P3][MemShrink:P3]
(In reply to Justin Lebar [:jlebar] from comment #31)
> > Wonder how extensions could interact with gfx.
> 
> If the add-on keeps images pinned in memory, they might stay pinned in gfx
> memory...  That's kind of what it looks like is happening from about:memory.

Fwiw, the    34,377,124 B -- gfx-d2d-surfacecache in the about:memory report is the amount of '100% extra' memory used by hardware acceleration (i.e. this is memory we're -sure- would not be used if HW accel is off). From the about:memory report it doesn't look like they're keeping a lot of additional images in memory.

Having said that, it's possible that drawing/caching lots and lots of images has other interactions with HW acceleration causing increased memory usage, it's hard to say without a reproducible scenario.
(In reply to Brian Carpenter [:geeknik] from comment #42)
> Haven't broke the 1GB barrier yet in memory usage. Creating the new profile
> seems to have solved my problems at least. After using Nightly for the last
> 2 hours or so, I'm only up to 635MB private working set.

I think that's enough to declare victory here, esp. given thatn it's been almost two years since this bug saw any action.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.