We are using icepdf 5.0.1 in my project to show the pdf files. Some files displayed not correctly, but when we run it in your demo and it works properly. I've tried to upgrade to 5.0.4 and it've thrown an exception
java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.<init>(Unknown Source)
at java.awt.image.SinglePixelPackedSampleModel.createDataBuffer(Unknown Source)
at sun.awt.image.IntegerInterleavedRaster.<init>(Unknown Source)
at sun.awt.image.IntegerInterleavedRaster.createCompatibleWritableRaster(Unknown Source)
at java.awt.image.AffineTransformOp.createCompatibleDestImage(Unknown Source)
So that I have to set the max-heap-size in my demo from 128mb to 256mb, it works without any exception. But I found one problem that my demo consumes 220mb instead of 110mb (old version 5.0.1). The memory consumption between 2 versions is too different. Could you please give me a solution so that I can avoid increasing the max-heap-size when running the demo or improve the performance of icepdf?
Please take a look on my attached file including my demo, pdf file and let me know if you need more information.
I've created http://jira.icesoft.org/browse/PDF-712 to track this issue. Some changes have been made to how an image mask is applied to an image for display. I still have to verify this but an alpha channel was added to most images types and maybe responsible of the memory spike you are seeing.