Closed
Bug 879320
Opened 11 years ago
Closed 3 years ago
Memory usage while reading big PDFs gradually increases until browser OOMs
Categories
(Firefox :: PDF Viewer, defect, P4)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: gcp, Unassigned)
References
Details
(Whiteboard: [pdfjs-c-performance])
Attachments
(3 files)
STR: 1) Load a big book, e.g. http://stacks.math.columbia.edu/download/book.pdf 2) Start scrolling, giving some minimal time to let individual pages load. 3) Watch memory usage. 4) See browser go boom as Firefox exceeds 2Gb RAM usage. Looks like decoded/rendered pages are cached but never freed.
Reporter | ||
Updated•11 years ago
|
Whiteboard: [MemShrink]
Maybe Firefox should discard PDF pages which are not displayed, like it does for images (if that's not the case).
Updated•11 years ago
|
Priority: -- → P4
Whiteboard: [MemShrink] → [MemShrink][pdfjs-c-performance]
Comment 2•11 years ago
|
||
An about:memory measurement would be very helpful. If you're on Nightly, please "Measure and save" and attach the resulting .json.gz file. Thanks!
Updated•11 years ago
|
Whiteboard: [MemShrink][pdfjs-c-performance] → [pdfjs-c-performance]
Reporter | ||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
This is WFM using Firefox 2 and newer. Getting ~700/750 MB Ram Usage on Scrolling through the first 20 Pages.
Reporter | ||
Comment 5•11 years ago
|
||
Still trivially reproduces on currently Nightly.
>Getting ~700/750 MB Ram Usage on Scrolling through the first 20 Pages.
Uh, the document has 3800+ pages. Try reading more than 1% of it.
Comment 6•10 years ago
|
||
gcp, how does Nightly do now? Memory usage seems ok to me now, considering the document size -- I couldn't get Firefox's RSS above ~800 MiB -- but maybe I'm not interacting with the document in the same way you are.
Reporter | ||
Comment 7•10 years ago
|
||
Reporter | ||
Comment 8•10 years ago
|
||
I can still get it arbitrarily high by browsing through the document. It seems to raise less sharply (i.e. pdf.js memory usage is better), but still keeps going up (i.e. it's still *leaking*). I attached a memory report where it's using about 2.3G.
Comment 9•10 years ago
|
||
This is interesting: > │ ├──719.08 MB (41.94%) -- top(http://stacks.math.columbia.edu/download/book.pdf, id=121) > │ │ ├──653.60 MB (38.12%) -- active/window(http://stacks.math.columbia.edu/download/book.pdf) > │ │ │ ├──402.67 MB (23.48%) -- dom > │ │ │ │ ├──390.55 MB (22.78%) ── orphan-nodes > │ │ │ │ └───12.12 MB (00.71%) ++ (5 tiny) As is this: > 4,372.27 MB ── gpu-committed > 1,580.04 MB ── gpu-dedicated > 20.52 MB ── gpu-shared
Comment 10•10 years ago
|
||
gcp: another interesting experiment would be to append "#textLayer=off" to the URL through which you access the file. This disables the text layer, which means you won't be able to select text, but it might make pdf.js faster and use less memory. I think it will also prevent orphan nodes from accumulating, since the text layer is the only part of pdf.js (AFAIK) that involves lots of DOM nodes.
Reporter | ||
Comment 11•10 years ago
|
||
Reporter | ||
Comment 12•10 years ago
|
||
Sounds like you found it indeed. Memory usage increases by about 300M when the PDF is opened, but increases negligibly after that and barely went over 900M even after reading halfway through it.
Comment 13•10 years ago
|
||
Bug 1054161 may help substantially.
Comment 14•3 years ago
|
||
Memory usage is not that high anymore, please reopen if you can still reproduce.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•