Open Bug 1174447 Opened 9 years ago Updated 1 year ago

Excessive CPU usage, High memory usage + Memory Leak at gamespot.com

Categories

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

38 Branch
x86_64
Windows 8.1
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dusty-2011, Unassigned)

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0
Build ID: 20150525141253

Steps to reproduce:

- Restarted my browser
- Opened a new tab
- Visited Gamespot.com
- Visited http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/ in a new tab
- Browsed through all 10 images on that page


Actual results:

Opening gamespot.com causes quite high CPU usage (around 30% on an i5-4590) for a while. Opening a new page on Gamespot also causes high CPU usage and high memory usage. Browsing through images also reloads advertisements which causes high CPU usage and memory usage. Closing a page on Gamespot also causes high CPU usage (I think in an attempt to free memory). The browser feels very slow and laggy.

I have recorded the memory usage of Firefox:

Before visiting Gamespot 353,4 MB
after opening gamespot 637,9 MB 
after waiting 10 sec 535,2 MB
after opening http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/  666,9 MB
waiting 10 sec 589 MB
browsing to image 5 out of 10: 755,4 MB
browsing to image 10 out of 10: 1008,1 MB
waiting 10 sec 798,1 MB
closing tab http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/  757,1 MB
closing tab http://www.gamespot.com/ 686,6 MB
waiting 30 secs  655,1 MB

Total leaked memory= memory usage after visiting Gamespot (655,1 MB) - before visiting gamespot (353,4MB)= 301,7MB

Firefox seems to leak quite enormous amounts of memory when browsing Gamespot.com


Expected results:

Browsing Gamespot.com is a much smoother experience in Internet Explorer 11 or Google Chrome. These browsers don't leak as much memory. CPU usage is also lower when browsing this website through these browsers.

I read somewhere that it's a good idea to open up new bug reports for cases where Firefox is clearly slower and laggier than other browsers. This is a good example of such a case.
I have verified the bug in a new and clean profile. Note that the starting amount of memory usage is much lower because there are no other inactive tabs open (with the above measurements, I had just restarted the browser but there were other tabs open, that were inactive).


In new profile:
Before visiting Gamespot (and no other inactive tabs open) 88,5 MB
after opening gamespot 211,2 MB
after waiting 10 sec 198,5 MB
after opening http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/ (in a new tab)  269,6 MB
waiting 10 sec 249,3 MB
browsing to image 5 out of 10: 342,9 MB
browsing to image 10 out of 10: 405,6 MB
waiting 10 sec 370,0 MB
closing tab http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/  365,6 MB
closing tab http://www.gamespot.com/ 330,5 MB
waiting 30 secs  305,8 MB

Total leaked memory= memory usage after visiting Gamespot (305,8 MB) - before visiting gamespot (88,5MB)= 217,3MB
After repeating all these steps a second time in the same browser session, memory usage ended up (after 30 sec wait) at 401,5MB. So another 95,7MB was leaked. After repeating all these steps a third time in the same browser session, memory usage ended up (after 30 sec wait) at 565,7MB. So another 164,2 MB was leaked. After repeating all these steps a fourth time in the same browser session, memory usage ended up (after 30 sec wait) at 674,7MB. So another 109,0 MB was leaked.

In total, 674,7-88,5=586,2 MB was leaked, when browsing gamespot.com during a 10 minute time period (would've been a 5 minute time period if I hadn't been noting down the MB's). This amount of leaking is not acceptable.

I have thus verified the memory leak in the new profile. CPU Usage in the new profile was similar. Gamespot also felt slow and laggy in the new profile.
This may be affected by the region, since different advertisements may be served depending on region. I live in The Netherlands.
I have now done additional testing, with Adblock Plus enabled. This is in my regular Firefox profile, after restarting the browser (the starting memory usage is far higher than in the clean profile because of opened but inactive tabs).

With Adblock Plus enabled:
Before visiting Gamespot 344,2 MB
after opening gamespot 402,3 MB
after waiting 10 sec 374,1 MB
after opening http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/ (in a new tab)  395,0 MB
waiting 10 sec 388,1 MB
browsing to image 5 out of 10: 424,6 MB
browsing to image 10 out of 10: 409,4 MB
waiting 10 sec 391,0 MB
closing tab http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/  386,9 MB
closing tab http://www.gamespot.com/ 397,0 MB
waiting 30 secs  367,9 MB

Total leaked memory= memory usage after visiting Gamespot (367,9 MB) - before visiting gamespot (344,2MB)= 23,7 MB

With Adblock Plus enabled, Gamespot.com uses far less CPU usage and is far more responsive (not slow and laggy). Gamespot.com also uses far less memory and there is no big memory leak.

So the problems (high CPU usage, high memory usage, and a big memory leak) are all caused by the advertisements on Gamespot.com. This may be a regional issue, since advertisements served can differ per region. I'm in The Netherlands.
I have also reported the bug to Gamespot.com, in case they can do something about this: http://www.gamespot.com/forums/bug-reporting-feedback-1000006/excessive-cpu-memory-usage-memory-leak-using-firef-32135885/#1

But the cause of the memory leak needs to be investigated, I suspect a Firefox bug to be behind it.
would you mind attaching some logs from about:memory page, after using minimize memory usage button there? Having before and after logs could help identify where is the biggest difference.
Attached file memory-report.json.gz
This is the requested log, before using the Minimize memory button.

This is from a new profile, after browsing through the Gamespot homepage and http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/ .
This is the requested log, after using the Minimize Memory button. Clicking this button only slightly reduced memory usage.
This is another log, from a new session. This time I closed down all Gamespot tabs before measuring (the previous log is with some gamespot tabs still open). This is with no tabs open, except about:memory tab. This is before using the minimize memory button.
The same as the previous log, but after using the Minimize Memory button. Using that button only slightly decreased memory usage.
I believe this page will also demonstrate the bug, much more effectively.  Tested with IE and Chrome, both did not exhibit the issue.

http://www.bbc.com/future/story/20150209-the-network-that-runs-the-world
Component: Untriaged → DOM
OS: Unspecified → Windows 8.1
Product: Firefox → Core
Hardware: Unspecified → x86_64
Hi dusty-2011, 

Can you try updating to Firefox 42 and see if you still have high CPU usage? Thanks.
Flags: needinfo?(dusty-2011)
(In reply to Grover Wimberly IV from comment #10)
> Hi dusty-2011, 
> 
> Can you try updating to Firefox 42 and see if you still have high CPU usage?
> Thanks.

Hi, I'm currently using Firefox 42 64-bit and I'm seeing exactly the same problems as with Firefox 38 32-bit. The problems I mentioned in the first post. CPU usage is still high. Memory usage still climbs crazily browsing through the images. After a while it does drop down a bit, but after closing down the gamespot tab and waiting for a minute memory usage is several hundred MBs higher than what I started with. So several hundred MBs leaked when browsing through the images here: http://www.gamespot.com/gallery/all-the-games-that-won-t-be-at-e3-2015/2900-180/
Flags: needinfo?(dusty-2011)
I see ~300MB memory usage after browsing through those images and after closing the tab
~225MB, on 64bit linux Nightly (non-e10s).
FF42 330MB when the tab is open and 225MB after couple of seconds after closing the tab.
FF42 seems to use more cpu when going through those images.

Memory usage after one has used the browser for awhile is expected to be higher than right after startup (various caches etc. are in memory, and memory fragmentation and what not).

Testing Windows...
On 32bit Windows Nightly (non-e10s) I see memory going up to 360MB and after closing the tab 270MB.
Opening the tab again and going through the image and then closing tab and minimizing mem usage, ~280MB. trying that again, and memusage ~277MB, and again, 282MB, and again, 281MB, and then 285MB, then 284MB, then 285MB

When testing Chrome the relevant child process seems to go up about 85MB from the initial state when loading that page and browsing through the images first time. So about the same as FF.
Going through the images again in Chrome seems to increase memory usage each time that 85MB.
FF has some similar behavior except that it seems to free that memory faster.


So locally I'm not seeing any high memory usage. Reporter, what kind of addons do you have installed?
Perhaps some of them cause some issues.


However, CPU usage in FF could be lower. It is not anything super high locally, but seems to be higher than in Chrome.
 Profiling...
Whiteboard: [MemShrink]
Oh, there was a comment about clean profile, nm the question about addons then.
(In reply to Tim McManus from comment #9)
> I believe this page will also demonstrate the bug, much more effectively. 
> Tested with IE and Chrome, both did not exhibit the issue.
> 
> http://www.bbc.com/future/story/20150209-the-network-that-runs-the-world

Please file a separate bug for this. It's quite possible that there is a separate underlying cause to your problem, and having multiple inputs into a single bug tends to lead to confusion. Thank you.
The high memory usage seems to be resolved, but the cpu usage is still concerning.
Whiteboard: [MemShrink]
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: