Open Bug 1020341 Opened 10 years ago Updated 2 years ago

Switching several times between print preview orientations has a significant impact performance-wise


(Firefox :: PDF Viewer, defect, P3)





(Reporter: avaida, Unassigned)



(Whiteboard: [pdfjs-integration][pdfjs-printing])

Reproducible on:
* Firefox 19.0 (Build ID: 20130215130331)
* Firefox 29.0.1 (Build ID: 20140506152807)
* Firefox 30.0 build1 (Build ID: 20140603140158)
* Aurora 2014-06-04
* Nightly 2014-06-04
using Windows 7 64-bit [1], Windows XP 32-bit [2], Windows 8 64-bit [3], Ubuntu 12.04 32-bit [4], Ubuntu 13.04 64-bit [5].

Steps to reproduce:
1. Launch Firefox.
2. Open a random PDF file and start Print Preview from Menu Bar > "File" > "Print Preview".
3. Switch several times between "Landscape" and "Portrait" orientation by pressing the associated buttons from the top toolbar or using keyboard shortcuts [alt] + L and [alt] + P to quickly switch.

Expected result:
Switching several times between preview orientations should not crash the browser, affect the browser in any negative way, or affect your hardware resources (CPU, RAM, etc) in a significant way.

Actual result:
Switching several times (at least 10 times) between orientations in a short amount of time has a significant impact especially on memory and CPU resources, with additional side-effects that vary from a platform to another.

Additional notes:
* This issue is not a regression since it's reproducible on Firefox 19.0, where PDF Viewer first landed.
* Mac OS X is not mentioned among the affected platforms here, since it uses a different print preview app called "Preview".
* Switching several times between "Landscape" and "Portrait" in Print Preview results in a heavy memory usage spike that lasts for as long as the Firefox process is running.
** e.g. 2,400 MB ~ memory usage for firefox.exe process alone, I noticed that as long as you keep switching between the two orientations, Firefox will keep eating more and more RAM without relieving any of it until it's closed
* Intermittently, Firefox crashes following an aggressive repetition of this specific action, but that's not always the case.
** In some cases, the "Preparing..." print preview dialog remains stuck and running even after the main process (firefox.exe) is closed.
** In other cases, specifically Windows XP & Windows 7, after repeatedly switching between orientations, closing the Print Preview window results in the placement of it's top toolbar in the browser's Menu Bar, overlapping the minimize, maximize, close buttons and everything else in that area. 
* Another thing worth mentioning here is that, sometimes, following the exact same steps in a Private Window has a significantly milder impact on the browser's responsiveness and the memory consumption increases in a less-aggressive way.

I suspect that all the differences in terms of behavior mentioned above, are actually caused by how Print Preview is affecting the browser and implicitly the machine's hardware resources.

Additional information regarding this analysis can be found in this google doc [6].

[1] Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
[2] Mozilla/5.0 (Windows NT 5.2; rv:30.0) Gecko/20100101 Firefox/30.0
[3] Mozilla/5.0 (Windows NT 6.2; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0
[4] Mozilla/5.0 (X11; Linux i686; rv:30.0) Gecko/20100101 Firefox/30.0
[5] Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0
Priority: -- → P3
Whiteboard: [pdfjs-c-ff-integration][pdfjs-d-printing]
Whiteboard: [pdfjs-c-ff-integration][pdfjs-d-printing] → [pdfjs-integration][pdfjs-printing]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.