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

OutOfMemoryError - during renderImageWithDPI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.0.17, 3.0.3 PDFBox, 4.0.0
    • 2.0.33, 3.0.4 PDFBox, 4.0.0
    • Rendering
    • None
    • macOS Mojave (10.14.6)
      Java 11.0.2 -Xmx10G -Xms10G

    Description

      During rendering pdf we receive java.lang.OutOfMemoryError: Java heap space

      Exception in thread "AWT-Shutdown" java.lang.OutOfMemoryError: Java heap spaceException in thread "AWT-Shutdown" java.lang.OutOfMemoryError: Java heap space at java.desktop/sun.awt.AppContext.getAppContexts(AppContext.java:167) at java.desktop/sun.awt.AppContext.stopEventDispatchThreads(AppContext.java:610) at java.desktop/sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:322) at java.base/java.lang.Thread.run(Thread.java:834)
      java.lang.OutOfMemoryError: Java heap space
       at java.desktop/sun.awt.geom.AreaOp.pruneEdges(AreaOp.java:362) at java.desktop/sun.awt.geom.AreaOp.calculate(AreaOp.java:159) at java.desktop/java.awt.geom.Area.intersect(Area.java:293) at org.apache.pdfbox.pdmodel.graphics.state.PDGraphicsState.intersectClippingPath(PDGraphicsState.java:618) at org.apache.pdfbox.pdmodel.graphics.state.PDGraphicsState.intersectClippingPath(PDGraphicsState.java:597) at org.apache.pdfbox.rendering.PageDrawer.endPath(PageDrawer.java:936) at org.apache.pdfbox.contentstream.operator.graphics.EndPath.process(EndPath.java:35) at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:869) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:505) at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:479) at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:152) at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:262) at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:314) at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:243) at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:229)

      We check the different setting of MemoryUsageSetting (TempFileOnly, MainMemoryOnly), settings of DPI.

      Attachments

        1. PDFBox4718Intersect.java
          1 kB
          Tilman Hausherr
        2. PDFBOX-4718-reduced.pdf
          1 kB
          Tilman Hausherr
        3. image-2019-12-19-05-55-57-648.png
          74 kB
          Tilman Hausherr
        4. example.pdf
          4.62 MB
          Serhii Kolesnyk

        Issue Links

          Activity

            People

              lehmi Andreas Lehmkühler
              serhii.kolesnyk Serhii Kolesnyk
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: