ICEpdf
  1. ICEpdf
  2. PDF-1158

OutOfMemoryError: Java heap space

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.2.4
    • Fix Version/s: 6.2.5
    • Component/s: Core/Rendering
    • Labels:
      None
    • Environment:
      All

      Description

      With the provided PDF the following error stack trace is thrown:

      Jun 08, 2017 1:43:28 PM org.icepdf.core.pobjects.ImageUtility createTranslucentCompatibleImage
      FINER: Creating translucent image buffer 1806x1806
      Jun 08, 2017 1:43:28 PM org.icepdf.ri.common.views.AbstractPageViewComponent$PageImageCaptureTask call
      WARNING: Error during page capture task: Java heap space 0
      java.lang.OutOfMemoryError: Java heap space
      at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
      at java.awt.image.Raster.createPackedRaster(Raster.java:467)
      at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
      at java.awt.GraphicsConfiguration.createCompatibleImage(GraphicsConfiguration.java:186)
      at org.icepdf.core.pobjects.ImageUtility.createTranslucentCompatibleImage(ImageUtility.java:142)
      at org.icepdf.core.pobjects.graphics.commands.FormDrawCmd.createBufferXObject(FormDrawCmd.java:236)
      at org.icepdf.core.pobjects.graphics.commands.FormDrawCmd.paintOperand(FormDrawCmd.java:133)
      at org.icepdf.core.pobjects.graphics.Shapes.paint(Shapes.java:147)
      at org.icepdf.core.pobjects.Page.paintPageContent(Page.java:600)
      at org.icepdf.core.pobjects.Page.paint(Page.java:546)
      at org.icepdf.ri.common.views.AbstractPageViewComponent$PageImageCaptureTask.call(AbstractPageViewComponent.java:429)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)

        Activity

        Arran Mccullough created issue -
        Hide
        Patrick Corless added a comment -

        I do wonder where the client get such odd pdfs. There are 196 star images on the page which are drawn as xobject vectors but because of an smask specification we render them to an image first and end up with 196 image @1806x1806 . Using org.icepdf.core.disableTransparencyGroup=true fixed the memory problem in the short term put won't be a valid fix for the client as they have many that require support for transparency groups. I'll need to take a closer look at the smask values to see if there is a way to avoid such a large memory spike.

        Show
        Patrick Corless added a comment - I do wonder where the client get such odd pdfs. There are 196 star images on the page which are drawn as xobject vectors but because of an smask specification we render them to an image first and end up with 196 image @1806x1806 . Using org.icepdf.core.disableTransparencyGroup=true fixed the memory problem in the short term put won't be a valid fix for the client as they have many that require support for transparency groups. I'll need to take a closer look at the smask values to see if there is a way to avoid such a large memory spike.
        Patrick Corless made changes -
        Field Original Value New Value
        Fix Version/s 6.2.5 [ 13102 ]
        Hide
        Patrick Corless added a comment -

        IT would appear the xobject buffer is getting created because it has a blendingmode attribute. The attribute value is normal and thus we shouldn't bother with creating the new buffer. Added a simple test for normal.

        Show
        Patrick Corless added a comment - IT would appear the xobject buffer is getting created because it has a blendingmode attribute. The attribute value is normal and thus we shouldn't bother with creating the new buffer. Added a simple test for normal.
        Hide
        Patrick Corless added a comment -

        Marking as fixed.

        Show
        Patrick Corless added a comment - Marking as fixed.
        Patrick Corless made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51626 Mon Jun 12 14:41:26 MDT 2017 patrick.corless PDF-1158 added check for a normal blending mode before kicking off the
        creating of a new FormDrawCmd.
        Files Changed
        Commit graph MODIFY /icepdf/trunk/icepdf/core/core-awt/src/main/java/org/icepdf/core/util/content/AbstractContentParser.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #51627 Mon Jun 12 14:41:40 MDT 2017 patrick.corless PDF-1158 added check for a normal blending mode before kicking off the
        creating of a new FormDrawCmd.
        Files Changed
        Commit graph MODIFY /icepdf/branches/icepdf-6.2.0/icepdf/core/src/org/icepdf/core/util/content/AbstractContentParser.java
        Patrick Corless made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: