Open Bug 1344540 Opened 7 years ago Updated 2 years ago

Multi second hangs

Categories

(Core :: DOM: Core & HTML, defect, P3)

51 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: frank, Unassigned)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170125094131

Steps to reproduce:

Having my Firefox open with all my pinned and other tabs.
(Yes, it is a mess, it is my mess.)
Letting it run for a while.


Actual results:

Firefox gets slower and slower (presumably sticking in GC), i.e. taking longer and longer breaks of unresponsiveness. Windows Taskmanager Memory consumption raises from around 1GB till up to 3GB when Firefox turns into being hardly usable at all.


Expected results:

Memory consumption could please plateau at some level and the breaks could just not happen, keeping Firefox responsive.
Comment on attachment 8843684 [details]
memory-report-20170305-gc.json.gz

This is a "near end" Firefox, after a manually enforced GC.
This is the same "near end" Firefox shortly before the manual gc.
This is Firefox after a restart, essentially same tabs as before.
Whiteboard: [MemShrink]
Hi Frank, thanks for reporting this issue. 

The best way to get to the root of an issue is to use the Gecko Profiler extension and sending us a link to the results. Follow the instructions at the link below and open the same tabs that cause the memory issue and this will help us better investigate. Thanks!

https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Reporting_a_Performance_Problem
Flags: needinfo?(frank)
Component: Untriaged → General
:njn, can the memory reports tell us anything useful here?
Component: General → Untriaged
Flags: needinfo?(n.nethercote)
You have a lot of ghost windows. (As well as a lot of top(none)/detached windows which are likely the same thing.) These leaks are probably causing your slowdowns, so there's no need for a profiler.

These ghost windows are for common sites like CNN, so there is likely some interaction with addons. Which addons do you have installed? You want to try to disable them until you can figure out which addon is causing it. AdBlockPlus, NoScript, and GreaseMonkey are addons that can interact badly with Firefox and cause leaks (which are really ultimately the fault of Firefox), so I'd try disabling some of those first if you have them.
Blocks: GhostWindows
Component: Untriaged → DOM
Flags: needinfo?(n.nethercote)
Flags: needinfo?(frank)
Product: Firefox → Core
Summary: Memory Leaks Getting Worse → Ghost windows (with addons?)
Need info for the question about addons.
Flags: needinfo?(frank)
Hi, I was fearing that answer. 

As a long standing Firefox user over the years I got used to many helpful plugins. I also realize, that HTML pages in 2017 are not the same as (say) 2010. 

Concerning AddOns, I have both: Country and Western and Greasemonkey and NoScript of the ones you list.

I have just deactivated GreaseMonkey and NoScript, though I wouldn't mind, to get them back. 
Here is my complete list of "guilt":

Activity Stream	1.1.8	true	@activity-streams
Add-on Compatibility Reporter	2.2.3	true	compatibility@addons.mozilla.org
Application Update Service Helper	1.0	true	aushelper@mozilla.org
Avast SafePrice	10.3.5.39	true	sp@avast.com
Check4Change	1.9.8.3	true	check4change-owner@mozdev.org
Classic Theme Restorer	1.6.2.1	true	ClassicThemeRestorer@ArisT2Noia4dev
Context Search X	0.4.6.26	true	contextsearch2@lwz.addons.mozilla.org
DNS Flusher	4.0.0	true	{7d575baa-b543-11dc-8314-0800200c9a66}
Fasterfox	3.9.85.1-signed.1-signed	true	{c36177c0-224a-11da-8cd6-0800200c9a91}
feedly	16.0.528.1-signed.1-signed	true	feedly@devhd
Firebug	2.0.19	true	firebug@software.joehewitt.com
Ghostery	7.1.3.1	true	firefox@ghostery.com
goo.gl lite	1.8.1.1-signed.1-signed	true	goo.gl_lite@matthew.flaschen.gatech.edu
HttpRequester	2.1.1-signed.1-signed	true	{ea4637dc-e014-4c17-9c2c-879322d23268}
IE Tab	4.0.20130422.1-signed.1-signed	true	{77b819fa-95ad-4f2c-ac7c-486b356188a9}
JSONView	1.2.4	true	jsonview@brh.numbera.com
Live HTTP headers	0.17.1-signed.1-signed	true	{8f8fe09b-0bd3-4470-bc1b-8cad42b8203a}
Modify Headers	0.7.1.1.1-signed.1-signed	true	{b749fc7c-e949-447f-926c-3f4eed6accfe}
Multi-process staged rollout	1.7	true	e10srollout@mozilla.org
OkayFreedom	1.6.0	true	{DB981CCA-088E-4731-A4A2-2FE218703C0E}
OneTab	1.17.0	true	extension@one-tab.com
Open With Google Chrome	49.0	true	{3cc6c6ba-654c-417e-a8af-6997ac388ae1}
Pocket	1.0.5	true	firefox@getpocket.com
Proxy Switcher	0.1.9	true	jid0-hjBdm7jJii7llLkqacvGnd3gHge@jetpack
Pushbullet	335	true	jid1-BYcQOfYfmBMd9A@jetpack
Save Image in Folder	1.3.18	true	{5e594888-3e8e-47da-b2c6-b0b545112f84}
Save Link in Folder	1.5.17	true	{7a46f9fe-4818-4837-ae4a-39c53978ae99}
Saved Password Editor	2.10.3	true	savedpasswordeditor@daniel.dawson
Status-4-Evar	2016.10.11.01	true	status4evar@caligonstudios.com
Test Pilot	0.9.2-dev-78214f8	true	@testpilot-addon
UAControl	0.1.3.1.1-signed.1-signed	true	uacontrol@qz.tsugumi.org
Unwrap Text	0.5.4.1-signed.1-signed	true	{DA4D8856-C1FB-499B-AA10-A6571A9C304D}
Web Compat	1.0	true	webcompat@mozilla.org
Web Developer	1.2.12	true	{c45c406e-ab73-11d8-be73-000a95be3b12}
Avast Online Security	12.0.88	false	wrc@avast.com
Greasefire2	2.1.1	false	greasefire2@b0nk3rz.net
Greasemonkey	3.10	false	{e4a8a97b-f2ed-450b-b12d-ee082ba24781}
NoScript	5.0	false	{73a6fe31-595d-460b-a920-fcc0f8843232}
Flags: needinfo?(frank)
Can you retest on 52 as well, that has just been released.
Flags: needinfo?(frank)
Will do. Just installed #52 and will use it with above configuration in my normal way, unless you tell to do something specifical to do/check, i.e. do memory dumps or whatever.
Flags: needinfo?(frank)
Attached find a new memory dump done with ff52 and NoScript and GreaseMonkey disabled. It is only a 2GB dump, but I am not sure, if the surftime is equivalent to the (near) 3GB dumps I attached earlier.
We're not seeing ghost windows anymore and considering you have ~80-90 tabs open 1.5GB explicit isn't terribly surprising. This seems like good progress!

It looks like you're on 64-bit windows, you might try out a 64-bit build of Firefox [1] as well. This could help out with low memory situations.

[1] https://support.mozilla.org/t5/Install-and-Update/How-to-switch-from-32-bit-to-64-bit-Firefox/ta-p/36215
I do not want to spoil the party, but first, I am now running without 2 of my favourite plugins less and second the process size has grown from 2GB about 3 hours ago (process size not heap or memory dump) to 2.5 now.

I am very fond of both, tabs and addons, and I think the 64bit edition was not working with many of the plugins I was used to, that was preventing me from upgrading.
It looks like you have no ghost windows, which is good. I do see 4 detached browser.xul, so maybe some addon is leaking window, but that's still not a lot. From your memory report, it just looks like you have a lot of tabs open, with a lot of YouTube frames, so the 1.6GB of allocations doesn't seem too unreasonable.

You do have a lot of "private" and the vsize is 3.3gb. I'm not sure what that means.

1,083.08 MB ── heap-allocated
1,322.00 MB ── heap-mapped
2,371.06 MB ── private
1,549.82 MB ── resident
1,609.58 MB ── resident-unique
3,314.75 MB ── vsize
I have 74 tabs open. I have no Youtube tabs open, and I can only find 2 youtube players in my Google+ tab. I do not know, what youtube frames are, but if you see many more than 2 players, I will do a careful recount. 

As a one time sidenote: From the gut feeling, it is the Google+ and Hangout Tabs (which I use a lot and pin them) which eat memory in Firefox. 

OK, I do not want to keep you busy, if I can help anything. I must see how I can keep up, if there are improvements to check.
You can look around yourself in your about:memory to get some sense of which tabs are taking a lot of memory, under window-objects. Hangouts is using 73MB, which is a good amount, but not a totally ridiculous amount.
The diff doesn't show much changing:

> 156.80 MB (100.0%) -- explicit
> ├───83.92 MB (53.52%) ++ window-objects
> ├───50.54 MB (32.23%) ── heap-unclassified

So 83MB in |window-objects|, which given 3 hours of browsing and changing pages isn't surprising. |heap-unclassified| has increased a bit which sometimes indicates leaks, but the overall value seems within our standard range:

> 253.89 MB (15.66%) ── heap-unclassified

More diff:

> 340.18 MB ── private
>   0.76 MB ── resident
>  56.87 MB ── resident-unique
>   1.86 MB ── system-heap-allocated
> 323.97 MB ── vsize

So vsize and private went up. Private's a weird measurement on windows [1]:

> The Commit Charge value in bytes for this process. Commit Charge is the
> total amount of memory that the memory manager has committed for a
> running process

So that increasing with vsize makes some sense.

[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms684874(v=vs.85).aspx
To repeat my initial questions, I consider the growths of the process a leak, cause essentially nothing being changed i.e. number of tabs constant, etc. And it is obvious, that something within Firefox is spending lots of CPU, i.e. as memory usage increases, more and more often ff freezes for 5, 10 15 seconds of complete stalling. I got two of those freezes while typing this text. Its magic when you type, suddenly no letters appear, then CPU fan steps up, Windows telling me, ff is not responding and then all of a sudden the letters typed "long ago" appear. As a remote Java person, it feels like a system under garbage collection pressure.
Web pages are not always static documents, so you can't really assume memory size will stay constant if they keep loading things. (Some pages continuously load new ads every so often, for instance.)

In terms of the hangs you are experiencing, if you set javascript.options.mem.log to true in about:config then you can look at the browser console under JS to get some information about what the GC and CC are doing. (Just don't leave the browser console open for long periods because it leaks pages...) From that information, we might be able to figure out why the hangs are so long, and if there's anything we can do to improve it.
Whow. That did not work too well. Enabled the setting, opened the console, can't read anything, way too much scrolling going on, probably due to the many tabs. Any means to direct that to a file?
Priority: -- → P3
I guess I'll update it for the current symptoms, now that you are not seeing ghost windows any more.

Maybe using the Profiler, as described in comment 4, is the best way forward. I'm not entirely sure how to diagnose hangs.
No longer blocks: GhostWindows
Summary: Ghost windows (with addons?) → Multi second hangs
Whiteboard: [MemShrink]
My guess is now, that this is just a variation of Bug 1374797.
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: