Closed
Bug 740171
Opened 13 years ago
Closed 11 years ago
Investigate pdf.js memory usage and find ways to reduce it
Categories
(Firefox :: PDF Viewer, enhancement)
Tracking
()
RESOLVED
DUPLICATE
of bug 881974
People
(Reporter: marco, Unassigned)
References
Details
(Keywords: meta, Whiteboard: [pdfjs-c-feature])
Attachments
(1 file)
122.19 KB,
application/pdf
|
Details |
pdf.js uses a lot of memory when opening big PDF files compared to other readers.
Sometimes I see high heap-unclassified numbers:
' 845.98 MB (100.0%) -- explicit
' ├──316.54 MB (37.42%) ── heap-unclassified
Reporter | ||
Comment 1•13 years ago
|
||
For example for this small PDF file, Firefox takes 50 MB.
Comment 2•13 years ago
|
||
I'll look at the heap-unclassified and then decide what to do with this.
Assignee: nobody → n.nethercote
Whiteboard: [MemShrink] → [MemShrink:P2]
Comment 3•13 years ago
|
||
I haven't run DMD yet but I was just browsing back and forth through http://njn.valgrind.org/pubs/phd2004.pdf and I got this:
1,230,914,043 B (100.0%) -- explicit
├────946,764,228 B (76.92%) ── heap-unclassified
Yikes.
Comment 4•13 years ago
|
||
We're aware of one bug where some data was being sent from the worker to the main thread causing a big duplication. We're also refactoring our API so all the data only lives in the worker thread.
Comment 5•12 years ago
|
||
> I haven't run DMD yet but I was just browsing back and forth through
> http://njn.valgrind.org/pubs/phd2004.pdf and I got this:
>
> 1,230,914,043 B (100.0%) -- explicit
> ├────946,764,228 B (76.92%) ── heap-unclassified
I just tried again and I couldn't get "explicit" above ~600MB and "heap-unclassified" was in the 20--25% range.
Marco, can you still reproduce this?
Reporter | ||
Comment 6•12 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #5)
> I just tried again and I couldn't get "explicit" above ~600MB and
> "heap-unclassified" was in the 20--25% range.
>
> Marco, can you still reproduce this?
I get ~60 MB for the pdf file I've attached and ~150 MB for your file.
Comment 7•12 years ago
|
||
> I get ~60 MB for the pdf file I've attached and ~150 MB for your file.
How does that compare with what you originally got? i.e. can we close this bug?
Reporter | ||
Comment 8•12 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #7)
> How does that compare with what you originally got? i.e. can we close this
> bug?
I originally got ~50 MB for the pdf file I've attached, so now it's using more memory than before (and it's just 2 pages long).
I still get really high memory usage with other pdf files compared to what I get with other readers, but not as much as before (i.e. not ~800 MBs, but ~400 MBs, when other readers take ~10 MBs). And heap-unclassified is now low (most of the memory is used by the worker and by the compartment for the PDF, so probably there's still that duplication that Brendan was talking about).
However I'm now testing with Linux, I don't know how Windows numbers look like.
Updated•12 years ago
|
Assignee: n.nethercote → nobody
Updated•12 years ago
|
Severity: normal → enhancement
Updated•12 years ago
|
Whiteboard: [MemShrink:P2] → [MemShrink:P2] [pdfjs-c-feature]
Comment 9•12 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #5)
> > I haven't run DMD yet but I was just browsing back and forth through
> > http://njn.valgrind.org/pubs/phd2004.pdf and I got this:
> >
> > 1,230,914,043 B (100.0%) -- explicit
> > ├────946,764,228 B (76.92%) ── heap-unclassified
>
> I just tried again and I couldn't get "explicit" above ~600MB and
> "heap-unclassified" was in the 20--25% range.
Now I get ~400MB for "explicit" and 11% "heap-unclassified". Good enough, I think.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 10•12 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #9)
> (In reply to Nicholas Nethercote [:njn] from comment #5)
> > > I haven't run DMD yet but I was just browsing back and forth through
> > > http://njn.valgrind.org/pubs/phd2004.pdf and I got this:
> > >
> > > 1,230,914,043 B (100.0%) -- explicit
> > > ├────946,764,228 B (76.92%) ── heap-unclassified
> >
> > I just tried again and I couldn't get "explicit" above ~600MB and
> > "heap-unclassified" was in the 20--25% range.
>
> Now I get ~400MB for "explicit" and 11% "heap-unclassified". Good enough, I
> think.
Do you get 400MB using another PDF reader?
I think 400MB is a lot of memory, above all if we want pdf.js on smartphones.
Reporter | ||
Updated•12 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Reporter | ||
Updated•12 years ago
|
Flags: needinfo?(n.nethercote)
Comment 11•12 years ago
|
||
The bug has no clear end-point. Please change the title so it has one.
Flags: needinfo?(n.nethercote)
Reporter | ||
Updated•12 years ago
|
Depends on: 839548
Summary: pdf.js uses too much memory → Investigate pdf.js memory usage and find ways to reduce it
Comment 12•12 years ago
|
||
meta bugs don't really need MemShrink tracking. Add the tag to any blocking bugs that seem relevant to MemShrink.
Keywords: meta
Whiteboard: [MemShrink:P2] [pdfjs-c-feature] → [pdfjs-c-feature]
Reporter | ||
Comment 13•12 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #12)
> meta bugs don't really need MemShrink tracking. Add the tag to any blocking
> bugs that seem relevant to MemShrink.
This bug is about investigating pdf.js high memory usage, in my opinion it should be MemShrink tagged until that investigation is carried through.
I mean, this is completely useless as a tracking bug if no investigation is done.
I don't know how to do this investigation, this is why I filed the bug. If you think pdf.js memory usage can't be improved, please close it.
Comment 14•12 years ago
|
||
FWIW I'm OK having the [MemShrink] tag on this even though it's a metabug, if Marco thinks that would help him get the attention he needs to identify the issues with PDF.js that need to be fixed.
Reporter | ||
Comment 15•12 years ago
|
||
(In reply to Justin Lebar [:jlebar] from comment #14)
> FWIW I'm OK having the [MemShrink] tag on this even though it's a metabug,
> if Marco thinks that would help him get the attention he needs to identify
> the issues with PDF.js that need to be fixed.
It's entirely up to you.
Reporter | ||
Comment 16•11 years ago
|
||
Looks like there's bug 881974 now.
Status: REOPENED → RESOLVED
Closed: 12 years ago → 11 years ago
Resolution: --- → DUPLICATE
Comment 17•11 years ago
|
||
> Looks like there's bug 881974 now.
Sorry I forgot about this one!
You need to log in
before you can comment on or make changes to this bug.
Description
•