Closed
Bug 1384094
Opened 7 years ago
Closed 7 years ago
High CPU. network traffic and memory usage when open Newtab page if you have opened / bookmarked a problematic/ huge game page in the past
Categories
(Firefox :: New Tab Page, defect, P1)
Tracking
()
People
(Reporter: alice0775, Assigned: Mardak)
References
(Blocks 3 open bugs, )
Details
(5 keywords, Whiteboard: [thumbnails])
Attachments
(5 files)
Reproducible: always
Steps To Reproduce:
0. Start with new profile
1. Open attached html and wait until the tab loading circle turns green
2. Exit browser and restart
3. Open Newtab Page (click [+] button)
---- observe CPU and Memory usage
Actual Results:
Even if there are about:home and Newtab page, browser consumes High CPU and memory.
Expected Results:
Very low CPU and memory usage.
WORKAROUND:
browser.newtabpage.enabled = false
and
browser.newtabpage.activity-stream.enabled = false (if activity-stream enabled)
Reporter | ||
Updated•7 years ago
|
Summary: High CPU and memory usage when open Newtab → High CPU and memory usage when open Newtab page
Reporter | ||
Comment 1•7 years ago
|
||
Another sample page attachment 8889630 [details]
Summary: High CPU and memory usage when open Newtab page → High CPU and memory usage when open Newtab page if you have opened a problematic page in the past
Reporter | ||
Comment 2•7 years ago
|
||
Reporter | ||
Comment 3•7 years ago
|
||
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5ceea82a79c7&tochange=2983ca6d4d1a
Regressed by:
Bug 870100 - Use BackgroundPageThumbs to capture user top sites that we don't currently capture
Mark Hammond [:markh],
Your patch trigger the problem. Could you look this?
Comment 4•7 years ago
|
||
We attempt to thumbnail pages, and yeah, if those pages manage to chew lots of CPU or memory, then the thumbnailer will too - while it's done in a content process, it will still be noticeable. Ideally we'd be able to use a sandbox and limit the memory and CPU used, but I'm not aware if that's possible yet.
Flags: needinfo?(markh)
Updated•7 years ago
|
Updated•7 years ago
|
status-firefox57:
--- → wontfix
Updated•7 years ago
|
Priority: -- → P3
Reporter | ||
Comment 5•7 years ago
|
||
Still happen. Reproduce easily.
If you encounter this problem at least once, you can not solve it except by destroy the user profile
Steps To Reproduce:
0. Start with new profile
1. Open attachment 8950552 [details] and wait for a while
2. Exit browser(kill all nightly process) and restart browser
3. Open Newtab Page (click [+] button)
---- observe CPU and Memory usage
status-firefox58:
--- → wontfix
status-firefox59:
--- → fix-optional
status-firefox60:
--- → affected
Reporter | ||
Comment 6•7 years ago
|
||
Now, Bug 1433324 has been landed in m-c,
No longer available workaround....
Blocks: 1433324
Assignee | ||
Comment 7•7 years ago
|
||
If it's caused by thumbnailing a top site, does browser.newtabpage.activity-stream.showTopSites=false avoid the problematic site?
Reporter | ||
Comment 8•7 years ago
|
||
(In reply to Ed Lee :Mardak from comment #7)
> If it's caused by thumbnailing a top site, does
> browser.newtabpage.activity-stream.showTopSites=false avoid the problematic
> site?
I can still reproduce :(
Assignee | ||
Comment 9•7 years ago
|
||
Oops sorry, can you also try setting browser.newtabpage.activity-stream.feeds.topsites=false ?
Reporter | ||
Comment 10•7 years ago
|
||
(In reply to Ed Lee :Mardak from comment #9)
> Oops sorry, can you also try setting
> browser.newtabpage.activity-stream.feeds.topsites=false ?
confirmed.
Setting the browser.newtabpage.activity-stream.feeds.topsites=false fixes the problem.
Reporter | ||
Comment 11•7 years ago
|
||
"Refresh Firefox" would not fix the problem.
It is wrong to try to load the page again without user permission when opening "New Tab".
I think the logic of making thumbnails is wrong.
Seems a security issue.
Component: New Tab Page → Activity Streams: Newtab
Reporter | ||
Updated•7 years ago
|
Keywords: ux-error-recovery
Reporter | ||
Comment 12•7 years ago
|
||
This page is also affected.
http://mzl.la/webassemblydemo
So, this bug is affected not only for a problematic page but also some game page.
I think that the thumbnail should be disabled until this bug is fixed. Because there are no way to fix the problem except about:config hack.
I will raise the importance of this bug.
Add "qawanted", this is very bad experiences. It impairs the reliability of the product.
Severity: normal → major
Keywords: qawanted
Summary: High CPU and memory usage when open Newtab page if you have opened a problematic page in the past → High CPU. network traffic and memory usage when open Newtab page if you have opened a problematic/ huge game page in the past
Reporter | ||
Updated•7 years ago
|
Whiteboard: [this is very bad experiences. It impairs the reliability of the product]
Reporter | ||
Comment 13•7 years ago
|
||
This page is also affected.
http://www.squarefree.com/bug523950/523950.gif
Assignee | ||
Updated•7 years ago
|
Whiteboard: [this is very bad experiences. It impairs the reliability of the product] → [thumbnails]
Comment 14•7 years ago
|
||
A partial fix would be to have a static "blank image" and use this whenever BackgroundPageThumbs gets a timeout capturing the page - that should mean the problem happens when the thumbnail is missing, then will not happen again until the thumbnail expires. Not a perfect fix, but possibly a good enough start.
Assignee | ||
Comment 15•7 years ago
|
||
(In reply to Mark Hammond [:markh] from comment #14)
> A partial fix would be to have a static "blank image" and use this whenever
> BackgroundPageThumbs gets a timeout capturing the page
Oh, that's an interesting "fix." We run into the recurring high CPU problem because we don't persist across restart failed thumbnails. We've previously had a temporary blacklist for twitch in bug 1412505, but that got reverted when the video error issue got fixed. But in general, there will be ways that loading pages will use up a lot of resources via javascript, large files, etc; and there won't really be ways to detect if even loading a page will be "bad" ahead of time.
So markh's suggestion is basically a dynamic blacklist implemented through the existing thumbnail storage mechanism so there doesn't need to be that much additional logic…
The main downside is what if the page actually becomes thumbnailable? Perhaps unlikely and oh well?
See Also: → 1412505
Comment 16•7 years ago
|
||
(In reply to Ed Lee :Mardak from comment #15)
> The main downside is what if the page actually becomes thumbnailable?
> Perhaps unlikely and oh well?
I believe thumbnails expire after 2 days - so I think the biggest downside is that we are likely to hit this that often, which might not appear like a "fix" at all.
Assignee | ||
Comment 18•7 years ago
|
||
(In reply to Mark Hammond [:markh] from comment #16)
> I believe thumbnails expire after 2 days
I think we can avoid the expiration with our explicit requests to not expire them.
https://github.com/mozilla/activity-stream/blob/e1ae13a2398f4702d71a0d5b03487618544f104c/system-addon/lib/TopSitesFeed.jsm#L70-L72
Blocks: 1437659
Iteration: --- → 61.1 - Mar 26
Summary: High CPU. network traffic and memory usage when open Newtab page if you have opened a problematic/ huge game page in the past → High CPU. network traffic and memory usage when open Newtab page if you have opened / bookmarked a problematic/ huge game page in the past
Assignee | ||
Comment 19•7 years ago
|
||
A quick hack and adding a top site of attachment 8948365 [details] seems to result in a white thumbnail with a 0-size file c3bb58cac6c9e281db3ca33867e4829f.png And restarting results in no new request and top site shows a white image (attached) and no more error messages in console after restarting.
```diff
diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
index 91063d9e9a28..c6313403c106 100644
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -518,12 +518,14 @@ Capture.prototype = {
Services.obs.notifyObservers(null, "clear-origin-attributes-data",
JSON.stringify({ userContextId: privateIdentity.userContextId }));
}
};
+ // If this background attempt failed, cause a dummy file to be saved, so
+ // that gets loaded instead of attempting again (and again).
if (!data) {
- done();
+ PageThumbs._store(this.url, this.url, null, true).then(done, done);
return;
}
PageThumbs._store(this.url, data.finalURL, data.imageData, true)
.then(done, done);
```
Updated•7 years ago
|
Assignee | ||
Updated•7 years ago
|
Updated•7 years ago
|
Assignee: nobody → edilee
Priority: -- → P1
Assignee | ||
Updated•7 years ago
|
Iteration: --- → 61.1 - Mar 26
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/activity-stream
https://github.com/mozilla/activity-stream/commit/c41b4e5fbb38820666e5ff2f67f293233f0602ce
fix(screenshots): Store an empty screenshot to avoid repeatedly requesting failures (#4050)
Fix Bug 1384094 - High CPU. network traffic and memory usage when open Newtab page if you have opened / bookmarked a problematic/ huge game page in the past
Updated•7 years ago
|
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/activity-stream
https://github.com/mozilla/activity-stream/commit/9632262414f4a99d2fbad56209927ed8df53e3df
Revert "Fix Bug 1384094 - High CPU. network traffic and memory usage when open Newtab page if you have opened / bookmarked a problematic/ huge game page in the past" (#4051)
This reverts commit c41b4e5fbb38820666e5ff2f67f293233f0602ce.
Assignee | ||
Updated•7 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/activity-stream
https://github.com/mozilla/activity-stream/commit/111ba085faa2d5b9685c79b7fa59b03f69555b17
fix(screenshots): Store an empty screenshot to return failure without repeat requests (#4052)
Fix Bug 1384094 - High CPU. network traffic and memory usage when open Newtab page if you have opened / bookmarked a problematic/ huge game page in the past
Updated•7 years ago
|
Status: REOPENED → RESOLVED
Closed: 7 years ago → 7 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 26•7 years ago
|
||
Target Milestone: --- → Firefox 61
Updated•7 years ago
|
Updated•7 years ago
|
Flags: qe-verify+
Comment 27•7 years ago
|
||
This issue has been reproduced on Firefox 56.0a1 (2017-07-24) with the exact same repro steps as per described in both Comment 5 and Description of the ticket.
The issue was not reproduced however on Nightly 62.0a1 (2018-05-09) and Firefox 61.0b3 on a Windows 10x64 machine with the following hardware configuration: 16GB’s of RAM and 8CPU’s with ~3.5GhZ.
Please see the below results for a more detailed overview of the CPU/Memory Usage:
56.0.1 :
Default: ~7% CPU / 35% Memory
After(during) opening HTML attach: ~20% CPU / 41% Memory
After restart+new Tab: ~47% CPU / 56% Memory
61.0b3
Default: ~5% CPU/ 33% Memory
After(during) opening HTML attach: ~17% CPU / 47% Memory
After restart+new Tab: ~17% CPU /47% Memory
62.0a.1:
Default: ~5% CPU / 33% Memory
After(during) opening HTML attach: ~17% CPU / 44% Memory
After restart+new Tab: ~18 %CPU / 44%Memory
Marking this issue as Verified-Fixed.
Comment 28•7 years ago
|
||
Hello Ed, could you please take a look at the comment above and give us your input on the results provided? Are those percentages of CPU/Memory usages the intended ones? Thank you
Flags: needinfo?(edilee)
Assignee | ||
Comment 29•7 years ago
|
||
Thanks for those numbers. Looks like CPU usage does avoid spiking after restart with the thumbnail fix.
Flags: needinfo?(edilee)
Comment 30•6 years ago
|
||
I'm still getting sky high CPU usage on 61.0b10, after a short while of idle time.
If replace "thumbnailed" new page with the "blank" one, everything's good.
Comment 31•6 years ago
|
||
(In reply to mirh from comment #30)
> I'm still getting sky high CPU usage on 61.0b10, after a short while of idle
> time.
>
> If replace "thumbnailed" new page with the "blank" one, everything's good.
After b13 or b14, everything seems perfect. Sorry for the noise.
Comment 33•6 years ago
|
||
I'm not sure if this will be relevant or not, but I ran into a PC freeze while running a test-case related to this.
While I'm aware that PC resources are relevant, the one I ran the test on had 8GB RAM, your typical HDD with an integrated Intel Graphics card.
Here are the steps followed:
1. Launch Firefox using a fresh profile.
2. Open and bookmark the following pages:
- http://www.mozdev.org/projects/nav.html
- http://www.squarefree.com/bug523950/523950.gif
3. Exit the browser and then reopen it.
- Make sure to check the CPU, network traffic and memory usage
I ran this test twice. On the second run, I got the PC freeze. Please note that this only occurred once and after I did a forced shutdown (killing the PC from the button) the issue was no longer reproducible (either using the old Fx profile or a new one).
Upon further investigation, I noticed that the Service Host: SuperFetch went into overdrive when Fx was open and those pages were loaded. Even after closing Fx the service would still overload the system.
Does Firefox interact with that service in any way?
Another colleague ran into a freeze on a laptop(4GB RAM) with Ubuntu 16.04 x32, running the same test case.
Updated•5 years ago
|
Component: Activity Streams: Newtab → New Tab Page
You need to log in
before you can comment on or make changes to this bug.
Description
•