Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.5
Description
I have a PDF file (which I can't share, it is p182 of the one from https://stackoverflow.com/questions/43248021/pdfbox-2-unusual-memory-consumption ) that needs over 3GB for rendering due to two stencil images that are 18694 x 13214. PDFBox converts stencil images to RGB images, where 1 pixel needs 4 bytes, so such an image uses 1GB.
After many dead ends over the easter weekend, I realized today that the BufferedImage isn't needed at all - we can process the bits directly.
Memory footprint is down from 3.6GB to 2.2GB and it is faster too.
Attachments
Issue Links
- duplicates
-
PDFBOX-2258 Speed up SampledImageReader#getStencilImage()
- Closed