OutOfMemoryError: Java heap space

Previous Topic Next Topic
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

OutOfMemoryError: Java heap space

Anzio John
This post has NOT been accepted by the mailing list yet.
Hi All,

I am working with itext. Am invoking some pdf files(almost 100 files) and drawing on each file. At last am concatenating all the files into a single file. But, on the process of drawing itself am facing Out of memory error: Java heap space error. Plz help me out. The error is provided below,

Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2271) [rt.jar:1.7.0_45]
        at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113) [rt.jar:1.7.0_45]
        at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) [rt.jar:1.7.0_45]
        at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140) [rt.jar:1.7.0_45]
        at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122) [rt.jar:1.7.0_45]
        at java.io.FilterOutputStream.write(FilterOutputStream.java:97) [rt.jar:1.7.0_45]
        at com.itextpdf.text.pdf.OutputStreamCounter.write(OutputStreamCounter.java:105) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PRStream.toPdf(PRStream.java:245) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfIndirectObject.writeTo(PdfIndirectObject.java:158) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfWriter$PdfBody.write(PdfWriter.java:420) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfWriter$PdfBody.add(PdfWriter.java:398) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfWriter.addToBody(PdfWriter.java:887) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:412) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfStamperImp.close(PdfStamperImp.java:386) [itextpdf-5.5.6.jar:5.5.6]
        at com.itextpdf.text.pdf.PdfStamper.close(PdfStamper.java:208) [itextpdf-5.5.6.jar:5.5.6]
Reply | Threaded
Open this post in threaded view

Re: OutOfMemoryError: Java heap space

This post has NOT been accepted by the mailing list yet.
Please do not use Nabble to post questions about iText. See http://itextpdf.com/support to learn how to get support. Your mail is marked with text on a yellow bar, saying "This post has NOT been accepted by the mailing list yet." The mailing list that is mentioned has been abandoned years ago.