Closed Bug 1406640 Opened 7 years ago Closed 2 years ago

Content process large CPU / Memory after new tab page opened with a specific page in history

Categories

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

55 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: yfdyh000, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: memory-footprint, memory-leak, top-memory-leak, Whiteboard: [fxperf:p3])

Attachments

(7 files)

Attached file bug profile.zip
STR:
1. Open Firefox with the profile in "bug profile.zip".
2. After the startup is complete (CPU steady), open an new tab.


Actual results:
Watch Task Manager and you will soon see a firefox.exe process bulging, taking up a CPU core and growing memory endlessly, exhausted system resources.

Terminating the process does not affect web pages and Firefox chrome, so I guess it is the WebExtension remote process (extensions.webextensions.remote).

The "places.sqlite" file extract from a profile that was running Firefox 55~Nightly 58. I cannot reproduce it in Firefox 54 or earlier, as it is an not backward compatible file since Firefox 55.


Expected results:
There is no cycle of death.
Keywords: footprint, mlk, topmlk
Blocks: 1410877
Priority: -- → P2
With Waterfox 56.0.4_4 on FreeBSD-CURRENT (56.0 was based on Firefox 56.0.2), 15.9G real memory, 8.00G swap and twelve previews on the new tab, I see: 

- a gradual rise in use of memory by one content process 

– however, it's not endless. It reaches a level then after a while, memory gradually decreases. 

If <https://files.unity3d.com/marcot/instancing/> is excluded from the twelve, then the level reached is significantly less.
I've just been testing this out and I think there's two issues here.

The first is that loading this page:

https://www.ib-formation.fr/catalogue/resultats-de-recherche

is taking up about 5GB of memory after a short time, and seems to keep increasing (I've tried this in two different profiles on my Mac).

The second is that this happening in the background - activity stream is attempting to load the page to create an image of it for about:newtab. It also never seems to actually succeed in the background (I don't know what the timeout is, but until I removed it from history, other images didn't load even after waiting a few minutes), so this seems to happen every time on startup, this is similar to bug 1384094, but makes me think we should have additional background limits.

I don't think this is places related, so moving across to activity stream.

Needinfo to Ed & Florian as this is activity stream / performance related.
No longer blocks: 1410877
Depends on: 1384094
Flags: needinfo?(florian)
Flags: needinfo?(edilee)
Priority: P2 → --
Summary: WebExtensions remote process dead loop after new tab page opened with a specific places.sqlite → Content process large CPU / Memory after new tab page opened with a specific page in history
Whiteboard: [fxperf]
Component: Places → Activity Streams: Newtab
Product: Toolkit → Firefox
I just tried loading the page in Google Chrome and I'm seeing the same issues - 100% CPU and rising memory early on around 2G, but rising to 4G after a few minutes (and keeping going).

Both Firefox & Chrome display the "web page is taking too long" prompts, but I'm guessing that activity stream is not handling that in its background work - that would be an improvement even if it doesn't stop the initial spinning/memory increase.
With bug 1384094, I do see high CPU when adding https://www.ib-formation.fr/catalogue/resultats-de-recherche as a top site. Eventually there's a 'getScreenshot(https://www.ib-formation.fr/catalogue/resultats-de-recherche) failed: Error: page-thumbnail:error' and a white thumbnail shows up (attached). Restarting Firefox shows the white thumbnail and no high CPU. Same thing with the page bookmarked.

So at least it won't happen on every restart with the fix/workaround.
Flags: needinfo?(edilee)
we have preliminary plans of removing the thumbnailer in Fx62, which would alleviate this (and other) problems
Flags: needinfo?(florian)
Whiteboard: [fxperf] → [fxperf:p2]
Priority: -- → P3
(In reply to Mark Banner (:standard8) from comment #6)

> … taking up about 5GB of memory after a short time, and seems to keep
> increasing (I've tried this in two different profiles on my Mac). …

I still don't get that _endless_ increase. 

Firefox  59.0.2_1,1 on (Tier-3) FreeBSD-CURRENT. I'll attach screenshots, the second of which shows the drop.
5,849M VIRT
4,607M RES
4,713M VIRT
3,469M RES
Depends on: 1509084
Whiteboard: [fxperf:p2] → [fxperf:p3]
Component: Activity Streams: Newtab → New Tab Page

The page at comment 6 is still causing a large memory increase, we don't have screenshots anymore in the New Tab page (and more in general we can't find any use in Firefox, though new Mozilla projects are using thumbnails), but the page is still causing the bug.
This looks related to page loading issues, rather than Firefox itself, we'd appreciate your help into figuring out why the load is consuming so many resources.

Component: New Tab Page → DOM: Core & HTML
Product: Firefox → Core
See Also: → 1162698

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: critical → --

The page in comment 6 is 404 now, so I don't know if it still endlessly leaks memory, but unfortunately endlessly leaking memory is always going to cause performance problems. It seems that the removal of thumbnailing should have at least improved the situation.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.