Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2825

Requested array size exceeds VM limit

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: Rendering
    • Labels:

      Description

      Hi, I've got this OOM exception when trying to render big file.

      Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
      	at java.util.Arrays.copyOf(Arrays.java:3230)
      	at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
      	at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
      	at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
      	at org.apache.pdfbox.io.IOUtils.copy(IOUtils.java:68)
      	at org.apache.pdfbox.io.IOUtils.toByteArray(IOUtils.java:50)
      	at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.from8bit(SampledImageReader.java:244)
      	at org.apache.pdfbox.pdmodel.graphics.image.SampledImageReader.getRGBImage(SampledImageReader.java:149)
      	at org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.getImage(PDImageXObject.java:246)
      	at org.apache.pdfbox.rendering.PageDrawer.drawImage(PageDrawer.java:766)
      	at org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:51)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:802)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:464)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:438)
      	at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
      	at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:180)
      	at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
      	at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
      	at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:69)
      	at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:56)
      

      It's there something way to fix this?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                DAndreev Dmitry Andreev
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: