ICEpdf
  1. ICEpdf
  2. PDF-721

Error creating buffer, page: 0

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.4, 5.0.5
    • Fix Version/s: 5.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      All

      Description

      When loading a customer provided PDF file the following error is thrown:

       Feb 25, 2014 9:44:04 AM org.icepdf.ri.common.views.PageViewComponentImpl$PagePainter run
      WARNING: Error creating buffer, page: 0
      java.lang.OutOfMemoryError: Java heap space
      at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
      at java.awt.image.Raster.createPackedRaster(Raster.java:470)
      at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
      at java.awt.image.BufferedImage.<init>(BufferedImage.java:338)
      at org.icepdf.core.pobjects.graphics.TilingPattern.paintPattern(TilingPattern.java:351)
      at org.icepdf.core.pobjects.graphics.commands.TilingPatternDrawCmd.paintOperand(TilingPatternDrawCmd.java:45)
      at org.icepdf.core.pobjects.graphics.Shapes.paint(Shapes.java:136)
      at org.icepdf.core.pobjects.Page.paintPageContent(Page.java:542)
      at org.icepdf.core.pobjects.Page.paint(Page.java:499)
      at org.icepdf.ri.common.views.PageViewComponentImpl.createBufferedPageImage(PageViewComponentImpl.java:843)
      at org.icepdf.ri.common.views.PageViewComponentImpl.access$400(PageViewComponentImpl.java:74)
      at org.icepdf.ri.common.views.PageViewComponentImpl$PagePainter.run(PageViewComponentImpl.java:992)
      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:722)

      I have the following parameters set:

      -Xms256M -Xmx1024M -XX:PermSize=256m -XX:MaxPermSize=1024m
      -Dorg.icepdf.core.target.dither=VALUE_DITHER_ENABLE
      -Dorg.icepdf.core.screen.render=VALUE_RENDER_QUALITY
      -Dorg.icepdf.core.screen.interpolation=VALUE_INTERPOLATION_BICUBIC
      -Dorg.icepdf.core.imageReference=smoothScaled

      Interesting if I remove the smoothScaled parameter I see the following NPE before the OOM error:

       WARNING: Error loading image: 7518 0R Image stream= {BitsPerComponent=8, Subtype=Image, Filter=FlateDecode, Type=XObject, Length=12, Height=3, Width=3, ColorSpace=DeviceRGB, SMask=12285 0R} 7518 0R
      java.lang.NullPointerException
      at org.icepdf.core.pobjects.ImageStream.getImage(ImageStream.java:202)
      at org.icepdf.core.pobjects.graphics.ImageStreamReference.call(ImageStreamReference.java:70)
      at org.icepdf.core.pobjects.graphics.ImageStreamReference.call(ImageStreamReference.java:39)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      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:722)

        Activity

        Hide
        Patrick Corless added a comment -

        I've taking a quick look at this one and the appears to be an unusual number of large titles (1428x1428) used for tiling patterns. Even if I give a very huge heap size the PDF can not render correctly. I'll need to take a look to see if there is anything unusual about the definition or if there is a way the tiles can be cached via some commonality.

        Show
        Patrick Corless added a comment - I've taking a quick look at this one and the appears to be an unusual number of large titles (1428x1428) used for tiling patterns. Even if I give a very huge heap size the PDF can not render correctly. I'll need to take a look to see if there is anything unusual about the definition or if there is a way the tiles can be cached via some commonality.
        Hide
        Patrick Corless added a comment -

        With all the imaging work done for 5.1 it appears it also affects this support case. The PDF in question can no be loaded with minimum heap size of 256M.

        Show
        Patrick Corless added a comment - With all the imaging work done for 5.1 it appears it also affects this support case. The PDF in question can no be loaded with minimum heap size of 256M.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: