If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Potential issue high memory usage on Aurora 38 windows x64 builds

RESOLVED WORKSFORME

Status

()

Firefox
General
RESOLVED WORKSFORME
3 years ago
3 years ago

People

(Reporter: cbadau, Unassigned)

Tracking

38 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(firefox38 affected)

Details

Attachments

(2 attachments)

(Reporter)

Description

3 years ago
Reproducible on latest Aurora 38.0a2 (buildID: 20150224004223)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0

I've opened several sites: facebook, youtube, YahooMail. I navigated on those sites and after a while (about half an hour), I saw high memory usage: ~1,2 GB. I have to mention that I had installed these addons: Ad Block, No Script, Yahoo Toolbar and Yandex Toolbar. 
I think the memory usage grow faster on Aurora x64 builds than on Aurora x32 builds. 

I will continue to investigate this issue in order to give more details.
Eric, do we have AWSY tests running for Firefox x64 builds already? I wonder if that is something we could check.
Flags: needinfo?(erahm)
(In reply to Henrik Skupin (:whimboo) from comment #1)
> Eric, do we have AWSY tests running for Firefox x64 builds already? I wonder
> if that is something we could check.

Unfortunately AWSY is limited to linux64 currently.

:cbadau can you get memory reports [1] at startup and then after the memory usage has gone up? Also if you can test with addons disabled [2] we can determine whether or not the addons are having an effect.

[1] https://developer.mozilla.org/en-US/docs/Mozilla/Performance/about:memory#How_to_generate_memory_reports
[2] 'Help' -> 'Restart with Add-ons disabled..'
Flags: needinfo?(erahm) → needinfo?(camelia.badau)
Whiteboard: [MemShrink]
(Reporter)

Comment 3

3 years ago
Created attachment 8569855 [details]
memory reports.zip

I've tested today on Windows 7 64bit using Aurora 38.0a2 (buildID: 20150225004902) x64 and x32 builds and using Firefox 36 RC Build 2 (buildID: 20150222232811) and here is additional information:

- Aurora 38.0a2 x64 build:
    - without Addons: - at startup (about:memory and home page opened) we have memory usage ~200MB
                      - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~1GB
                      - sites opened: Facebook, Youtube and YahooMail -> after 40 minutes of navigation on those sites, we have memory usage ~1,2GB/1,3GB
    
    - with Addons: - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~1GB
                   - sites opened: Facebook, Youtube and YahooMail -> after 40 minutes of navigation on those sites, we have memory usage ~1,2GB/1,3GB

- Aurora 38.0a2 x32 build:
    - with Addons: - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~700MB/750MB
                   - sites opened: Facebook, Youtube and YahooMail -> after 40 minutes of navigation on those sites, we have memory usage ~900MB/950MB
    
    - without Addons (on Safe Mode): - sites opened: Facebook, Youtube and YahooMail -> before navigation, we have memory usage ~400MB
                      - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~500MB
                      - sites opened: Facebook, Youtube and YahooMail -> after 30 minutes of navigation on those sites, we have memory usage ~700MB

- Firefox 36 RC (Build 2) x32 build:
    - without Addons: - at startup (about:memory and home page opened) we have memory usage ~130MB
                      - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~420MB
                      - sites opened: Facebook, Youtube and YahooMail -> after 30 minutes of navigation on those sites, we have memory usage ~450MB
    
    - with Addons: - sites opened: Facebook, Youtube and YahooMail -> after 10 minutes of navigation on those sites, we have memory usage ~500MB
                   - sites opened: Facebook, Youtube and YahooMail -> after 40 minutes of navigation on those sites, we have memory usage ~600MB

I also attached the memory reports (at startup and after the memory usage gone up).
Flags: needinfo?(camelia.badau)
:cbadau, thank you for the thorough reports!

So first things first, a 64-bit build will inherently use more memory than a 32-bit build. We can't expect parity but it shouldn't be drastically larger.

It looks like you had a dev tools web console open in the 64-bit version but not the 32-bit version, this *could* be severely skewing the numbers (I'm seeing a lot of strings that look like network profiling of some sort). Additionally I'm seeing a fair amount of orphan-nodes, I *think* these should go away when we minimize memory usage so again, it's not exactly a fair comparison.

Ideally we'd need to remeasure the add-ons disabled case for 32 and 64 after running for 40 minutes with:
  * exactly the same set of windows open (no dev tools)
  * before measuring memory click the 'Minimize memory usage' button
  * don't open about:memory until you measure, or close the about:memory tab in b/w measurements

I started digging in a bit further, but I think it would be best to get the new measurements first. In the meantime I'll try to see if I can get a better grasp on what the expected difference in size would be b/w 32 and 64 bit builds.
Flags: needinfo?(camelia.badau)
(Reporter)

Comment 5

3 years ago
Created attachment 8571325 [details]
new memory reports.zip

I've retested today on Windows 7 64bit using latest Aurora 38.0a2 (buildID: 20150301004021) x64 and x32 builds: 
-> sites opened: Facebook, Youtube and YahooMail
      - Aurora 38.0a2 x64 build (without add-ons) -> after 40 minutes of navigation on those sites, we have memory usage ~900MB
      - Aurora 38.0a2 x32 build (without add-ons) -> after 40 minutes of navigation on those sites, we have memory usage ~700/800MB

I also attached new memory reports. Please see attachment "new memory reports.zip".
Flags: needinfo?(camelia.badau)
Whiteboard: [MemShrink]
:cbadau thank you again for the detailed reports. A 106 MiB increase in explicit (~20%) feels more in line with what we would expect between a 32-bit and 64-bit build.

For background:
I looked into the increase of the size of a basic JavaScript Function object from 32-bit to 64-bit. It fell into the worst case scenario of doubling in size from 32-bytes to 64-bytes. That gives an idea of what can happen when internal objects are using a lot of pointers.

So for us an increase of 20% is reasonable, particularly now that we can use much more virtual memory in the 64-bit build.

I'm going to close this, but if you feel like we should look further into the disparity in memory usage between 32-bit and 64-bit builds feel free to reopen.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
Mistakenly filed against Firefox 38 and should be instead 38 Branch. Sorry for the spam. dkl
Version: Firefox 38 → 38 Branch
You need to log in before you can comment on or make changes to this bug.