Open Bug 881974 Opened 6 years ago Updated 2 months ago

pdf.js uses too much memory


(Firefox :: PDF Viewer, defect, P3)





(Reporter: njn, Unassigned)


(Depends on 5 open bugs, Blocks 1 open bug)


(Whiteboard: [MemShrink:P2][pdfjs-c-performance])

pdf.js uses too much memory, at least in some cases.  This is bad, because PDFs are common, and the introduction of pdf.js made it hard to open PDFs in any other way.

This is a meta-bug for tracking specific problems.  I'll put the MemShrink tag on this bug, not on the individual blocking bugs.
Duplicate of this bug: 740171
Blocks: 834358
Depends on: 839548
Is it possible to hibernate pdf.js (or parts of it) when not in use (i. e. in a background tab)? That will at least help reduce excessive memory usage in some use cases (e. g. when someone opens multiple PDFs at once). 

Would it be possible to implement such a hibernation mode?
Depends on: 863159
Priority: -- → P3
Whiteboard: [MemShrink:P1] → [MemShrink:P1][pdfjs-c-performance]
Depends on: 876906
Duplicate of this bug: 871249
Here's a user on the support forums also reporting this issue:
I am also seeing extremely high memory usage of 1GB or more when viewing PDF files of scanned images.  See further details at  Please let me know if I can provide more information to help resolve this issue.
Depends on: 845083
Depends on: 931468
Depends on: 959925
Depends on: 885287
No longer blocks: 949650
Depends on: 949650
Depends on: 962351
Depends on: 962933
Depends on: 965130
Depends on: 966865
Things are much better now, and I've recently landed a few more patches to the master pdf.js repo that haven't yet been merged into Firefox. I think this can be safely downgraded to a MemShrink:P2. If anyone has example documents that still cause high memory consumption please let me know.
Whiteboard: [MemShrink:P1][pdfjs-c-performance] → [MemShrink:P2][pdfjs-c-performance]
Depends on: 992125
I made some additional improvements, described here:
Depends on: 1054161
Should also depend on bug 1005005, bug 1165624 and bug 1262736
Depends on: 1005005, 1165624, 1262736
You need to log in before you can comment on or make changes to this bug.