Open Bug 1053840 Opened 5 years ago Updated 5 months ago

exceptionally high CPU load when only downloading a file, only downloads window open

Categories

(Firefox :: General, defect)

31 Branch
x86_64
macOS
defect
Not set

Tracking

()

People

(Reporter: bugzilla, Unassigned)

References

Details

Attachments

(1 file)

Reproduce steps:
1. Go to a URL with a decent size file to download; Google Drive, Dropbox, etc.
2. Initiate download.
3. Go to Tools > Downloads.
4. Close the prior window such that only the Downloads window is showing.

Results: Activity Monitor and top both show FireFox using 42-48% CPU.


Additional results: Doing this with the same build of Firefox on Fedora 21 (prerelease) doesn't reproduce the problem, it uses ~1% CPU following these same steps.

Additional test:
1. Launch Firefox, go to and login to a gmail account.
2. Hide Firefox.

On OS X, this one "background" gmail window task consumes 31% CPU. On Linux it's 0.2%.
Hardware: x86 → x86_64
This sample is taken while Firefox has only the Downloads window open, while downloading a ZIP file from Dropbox. 

CPU% for Firefox is > 40%, the kernel task uses 21%. Laptop fans are at medium-low but are audible. Upon download complete, the fans go to quiet, and Firefox uses 0.1% and kernel task uses less than 3%.
OK I love it when I go to collect data and get different results...

 PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND 
 1841 chris     20   0 1080784 185396  75372 S  51.4  5.2   2:41.95 firefox  

And this is just with a regular blank browser window open, the Library window isn't open (the equivalent of the Downloads window in OS X). If I do the same thing as on OS X, by opening Library and closing the browser window, firefix, gnome-shell, and Xorg combined consume 130% CPU. Just to download one file.

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                                                                                                      
 1841 chris     20   0 1065168 180092  75052 S  79.8  5.0   3:55.90 firefox                                                                                                                                                      
 1442 chris     20   0 1797496 156172  88516 R  27.0  4.3   1:16.51 gnome-shell                                                                                                                                                  
  865 root      20   0  341716  59476  23804 S  23.1  1.7   1:09.37 Xorg.bin  

I think that's really unreasonable. And then as soon as the download finishes:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND  
 1841 chris     20   0 1060036 182760  75288 S   0.1  5.1   7:53.13 firefox  
  865 root      20   0  342228  59736  24060 S   5.0  1.7   2:36.74 Xorg.bin                                                                                                                                                     
 1442 chris     20   0 1797628 154356  88520 S   4.4  4.3   3:02.48 gnome-shell  

I don't know the equivalent of sample on linux, but if a dev wants me to capture something let me know.

This bug should strictly be about downloading files (Download window on OS X, Library window on Linux). And I'll file a separate bug for the different gmail behavior since that's probably javascript related.
Summary: higher CPU load on OS X than the same task on Linux → exceptionally high CPU load when only downloading a file, no other windows open
Hi,
I reproduced the issue.
Latest nightly. Downloading latest mac nightly from nightly with only empty tab open 40% cpu usage.
Report http://people.mozilla.org/~bgirard/cleopatra/#report=d1ad4e4efce6fcffc984f33b838a8df1e6000c94

Regards,
Piotr
Another thing. It looks like it is the wakeup thing as in https://bugzilla.mozilla.org/show_bug.cgi?id=1112701

makbuczek:~ pio$ sudo powermetrics -W -s tasks |egrep -e firefox -e '^Name' -e 'Sampled system activity'
Password:
*** Sampled system activity (Mon Aug  3 22:09:24 2015 +0200) (5003.91ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   504.34    74.95  1.80    2.60               57.35   30.38             
*** Sampled system activity (Mon Aug  3 22:09:29 2015 +0200) (5005.83ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   596.71    75.13  2.60    2.40               59.53   20.78             
*** Sampled system activity (Mon Aug  3 22:09:34 2015 +0200) (5003.34ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   593.25    74.49  0.80    2.80               56.16   24.98             
*** Sampled system activity (Mon Aug  3 22:09:39 2015 +0200) (5004.97ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   585.78    74.19  2.60    2.40               56.55   22.18             
*** Sampled system activity (Mon Aug  3 22:09:44 2015 +0200) (5003.48ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   139.56    88.95  0.60    0.40               44.37   26.18             
*** Sampled system activity (Mon Aug  3 22:09:49 2015 +0200) (5004.41ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   8.25      79.33  0.20    0.20               8.79    5.40              
*** Sampled system activity (Mon Aug  3 22:09:54 2015 +0200) (5004.42ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   4.48      70.89  0.00    0.00               4.40    4.00              
*** Sampled system activity (Mon Aug  3 22:09:59 2015 +0200) (5003.70ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   10.57     88.63  0.00    0.00               4.40    3.20              
*** Sampled system activity (Mon Aug  3 22:10:04 2015 +0200) (5003.18ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   5.83      77.20  0.00    0.00               4.00    2.80              
*** Sampled system activity (Mon Aug  3 22:10:09 2015 +0200) (5003.46ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   6.11      79.71  0.00    0.00               4.60    3.20              
*** Sampled system activity (Mon Aug  3 22:10:14 2015 +0200) (5003.60ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   2.56      64.68  0.00    0.00               2.60    1.40              
*** Sampled system activity (Mon Aug  3 22:10:19 2015 +0200) (5003.47ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   2.06      64.35  0.00    0.00               1.00    0.80              
*** Sampled system activity (Mon Aug  3 22:10:24 2015 +0200) (5004.22ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   193.25    69.83  0.20    0.40               55.55   26.78             
*** Sampled system activity (Mon Aug  3 22:10:29 2015 +0200) (5003.63ms elapsed) ***
Name                               ID     CPU ms/s  User%  Deadlines (<2 ms, 2-5 ms)  Wakeups (Intr, Pkg idle)
firefox                            1198   202.88    79.96  2.20    2.00               72.35   39.37
Summary: exceptionally high CPU load when only downloading a file, no other windows open → exceptionally high CPU load when only downloading a file, only downloads window open
Depends on: 1562032
You need to log in before you can comment on or make changes to this bug.