Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 6.1.2
-
Fix Version/s: 6.1.3
-
Component/s: Core/Rendering
-
Labels:None
-
Environment:All
-
Support Case References:Support Case #13893 - https://icesoft.my.salesforce.com/5007000001eMbmW
Description
When rendering the provided PDF file, the following error is thrown which is preventing the content from displaying properly:
WARNING: Error creating buffer, page: 0
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
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.TilingPattern.paintPattern(TilingPattern.java:389)
at org.icepdf.core.pobjects.graphics.commands.TilingPatternDrawCmd.paintOperand(TilingPatternDrawCmd.java:45)
at org.icepdf.core.pobjects.graphics.Shapes.paint(Shapes.java:148)
at org.icepdf.core.pobjects.Page.paintPageContent(Page.java:596)
at org.icepdf.core.pobjects.Page.paint(Page.java:544)
at org.icepdf.ri.common.views.PageViewComponentImpl.createBufferedPageImage(PageViewComponentImpl.java:973)
at org.icepdf.ri.common.views.PageViewComponentImpl.access$400(PageViewComponentImpl.java:80)
at org.icepdf.ri.common.views.PageViewComponentImpl$PagePainter.run(PageViewComponentImpl.java:1097)
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)
WARNING: Error creating buffer, page: 0
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
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.TilingPattern.paintPattern(TilingPattern.java:389)
at org.icepdf.core.pobjects.graphics.commands.TilingPatternDrawCmd.paintOperand(TilingPatternDrawCmd.java:45)
at org.icepdf.core.pobjects.graphics.Shapes.paint(Shapes.java:148)
at org.icepdf.core.pobjects.Page.paintPageContent(Page.java:596)
at org.icepdf.core.pobjects.Page.paint(Page.java:544)
at org.icepdf.ri.common.views.PageViewComponentImpl.createBufferedPageImage(PageViewComponentImpl.java:973)
at org.icepdf.ri.common.views.PageViewComponentImpl.access$400(PageViewComponentImpl.java:80)
at org.icepdf.ri.common.views.PageViewComponentImpl$PagePainter.run(PageViewComponentImpl.java:1097)
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)
Kind of a cool looking PDF. The memory peek is coming from a very large image tile that is 1016000x1016000 after being converted to page space. this large a tile hasn't shown up before in our test set. It's pretty easy to detect such a large image and shrink it accordingly. Once this code is added the PDF renders correctly.