PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting Tiff Image Loader causing problems running a Lotus Notes age

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #26403

    I am calling the Tiff Image Loader from within a Notes agent and I’m getting this error:
    <br /> BlockElement(body) {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@14031403, display=block, width=900, margin-left=10, margin-top=0, margin-bottom=8, margin-right=8, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@14031403, display=block, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@14031403, display=block, font-size=16}<br /> <br /> java.lang.OutOfMemoryError<br /> at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:52)<br /> at java.awt.image.Raster.createPackedRaster(Raster.java:469)<br /> at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1026)<br /> at java.awt.image.IndexColorModel.convertToIntDiscrete(IndexColorModel.java:1437)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:194)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at com.cmti.pdfgen.PDFMaker.generate(PDFMaker.java:202)<br /> at com.cmti.pdfgen.PDFMaker.generate(PDFMaker.java:147)<br /> at com.ssatb.conotes.CategorizedController.execute(CategorizedController.java:144)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Exception in thread "AgentThread: JavaAgent" java.lang.OutOfMemoryError<br /> at sun.misc.FloatingDecimal.developLongDigits(FloatingDecimal.java:363)<br /> at sun.misc.FloatingDecimal.dtoa(FloatingDecimal.java:561)<br /> at sun.misc.FloatingDecimal.<init>(FloatingDecimal.java:514)<br /> at java.lang.Float.toString(Float.java:193)<br /> at java.lang.String.valueOf(String.java:1479)<br /> at java.lang.StringBuffer.append(StringBuffer.java:154)<br /> at org.zefer.pd4ml.pdf.c.o00000(Unknown Source)<br /> at org.zefer.pd4ml.pdf.c.ôÒ0000(Unknown Source)<br /> at org.zefer.pd4ml.pdf.c.ÔO0000(Unknown Source)<br /> at org.zefer.pd4ml.pdf.PD4Device.startNewPage(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at com.cmti.pdfgen.PDFMaker.generate(PDFMaker.java:202)<br /> at com.cmti.pdfgen.PDFMaker.generate(PDFMaker.java:147)<br /> at com.ssatb.conotes.CategorizedController.execute(CategorizedController.java:144)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br />

    Assuming its a mere memory limit issue, I can try to find how to increase the heap size alolotted to a Notes client agent. If ethere’s something else I should know please do tell…

    Thx,
    -Jake

    #28052

    Yes, images with big dimensions normally require a lot of RAM and easily exceed small default JVM max heap size.

    You may override the default JVM max heap size value in notes.ini
    For example
    JavaMaxHeapSize=671088640
    or
    JavaMaxHeapSize=640mb

    The only problem is that you need to manually do the .INI changes on all client PCs.

    #28053

    that didn’t seem to make a difference. The images aren’t big and the first 2 at 48k didn’t seem to pose a problem. The 3rd, also at 48k causes the exception -even though for testing purposes it’s just a copy of the 2nd. This is what leads me to worry of a more serious leak.

    #28054

    I would expect a memory leak exposes itself a different way. Here it looks like an allocation of a huge amount of memory.

    How many bytes does com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes() return for the three images?

    #28051

    I suspect we are actually dealing with two problems. I’ve isolated the test case by creating the large HTML file that is to be converted to PDF using PD4ML and verified that it works in my IDE (Eclipse) When trying to convert the file using the exact same code as Notes agent it fails with the following dump: (Kindly read until end as there is more explanation after the dump)
    <br /> BlockElement(body) {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, width=900, margin-left=10, margin-top=0, margin-bottom=8, margin-right=8, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, font-size=16}<br /> ContentElement(pd4content) [ ] {line-height=1.2000000476837158, font-family=[Ljava.lang.String;@662f662f, display=block, font-size=16}<br /> <br /> com.sun.media.jai.codecimpl.util.ImagingException<br /> at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:71)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:218)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Caused by: com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.<br /> ... 22 more<br /> Caused by: java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> ... 21 more<br /> Caused by:<br /> com.sun.media.jai.codecimpl.util.ImagingException: IOException occurs when encode the image.<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:218)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Caused by: java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> ... 21 more<br /> Caused by:<br /> java.io.IOException: reading encoded JPEG Stream<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.writeJPEGStream(Native Method)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:484)<br /> at sun.awt.image.codec.JPEGImageEncoderImpl.encode(JPEGImageEncoderImpl.java:240)<br /> at com.sun.media.jai.codecimpl.JPEGImageEncoder.encode(JPEGImageEncoder.java:215)<br /> at com.cmti.pdfgen.TiffImageLoader.readAndConvertTiff(TiffImageLoader.java:87)<br /> at com.cmti.pdfgen.TiffImageLoader.getResourceAsBytes(TiffImageLoader.java:62)<br /> at org.zefer.cache.ResourceCache.getObjectAlternativeWay(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.thisvoid(Unknown Source)<br /> at org.zefer.html.doc.n.Õõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.if(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br /> Exception in thread "AgentThread: JavaAgent" java.lang.OutOfMemoryError<br /> at java.lang.StringBuffer.ensureCapacityImpl(StringBuffer.java:335)<br /> at java.lang.StringBuffer.append(StringBuffer.java:201)<br /> at org.zefer.pd4ml.pdf.c.Ôo0000(Unknown Source)<br /> at org.zefer.pd4ml.pdf.PD4Device.isNewPageNeeded(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at PD4MLOnlyTest.render(PD4MLOnlyTest.java:40)<br /> at JavaAgent.NotesMain(Unknown Source)<br /> at lotus.domino.AgentBase.runNotes(Unknown Source)<br /> at lotus.domino.NotesThread.run(Unknown Source)<br />

    I have three copies of the HTML file. One with no images at all and it runs fine in Both Eclipse and as a Notes agent. One with a small (4k) .png image in the header of every other page for a total of 100 images in a 200 page PDF. This also runs to completion in both Eclipse and Notes. The third HTML file has the same header images as the second and 4 TIFF images (one each on the 2nd, 4th, 6th and 8th page of the 200 page PDF output) This file runs fine on Eclipse but fails in the Notes agent with the above dump. The image sizes you requested for TiffImageLoader.getResourceAsBytes are:
    <br /> Image URL: file:///C:UsersXXXXXXXXXX/038/038011074/WS/057008072_WS.TIF<br /> BYTE SIZE: 31982<br /> Image URL: file:///C:UsersXXXXXXXXXX/028/028009113/WS/041013397_WS.TIF<br /> BYTE SIZE: 48640<br /> Image URL: file:///C:UsersXXXXXXXXXX/028/028009113/WS/047020674_WS.TIF<br /> BYTE SIZE: 48640<br /> Image URL: file:///C:UsersXXXXXXXXXX/048/048008877/WS/051006769_WS.TIF<br /> BYTE SIZE: 40704<br />
    Note that the TiffImageLoader class is one that you supplied in your examples.

    #28055

    .ini:
    JavaStackSize=819200

    default is 409600

    Seems it’s the stack not the heap causing the problem. I’ll continue to stress test this and keep this forum informed

    #28056

    Currently we work on a PD4ML version, which is able to cache resources in /tmp directory, which should help to reduce memory utilization. Please contact support pd4ml com if you are interested to give a try to a development build.

Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.