HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Getting HEAP SPACE-OUT OF MEMORY when processing large files
- This topic has 5 replies, 3 voices, and was last updated Mar 02, 2015
18:48:38 byPD4ML.
-
AuthorPosts
-
March 6, 2013 at 07:41#26821
when processing html files of large size 7 – 11MB ,OutOfMemoryError: Java heap space error is occurring
java.lang.OutOfMemoryError: Java heap space
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:99)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:393)
at java.lang.StringBuffer.append(StringBuffer.java:225)
at org.zefer.pd4ml.pdf.f.do(Unknown Source)
at org.zefer.pd4ml.pdf.f.ÓO0000(Unknown Source)
at org.zefer.pd4ml.pdf.PD4Device.startNewPage(Unknown Source)
at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)some times:
java.lang.OutOfMemoryError: Java heap space
at org.zefer.html.c.g.super(Unknown Source)
at org.zefer.html.c.b.privatesuper(Unknown Source)
at org.zefer.html.c.b.Ôo0000(Unknown Source)
at org.zefer.html.c.f.Ô00000(Unknown Source)
at org.zefer.html.c.f.Ó00000(Unknown Source)
at org.zefer.html.c.f.ø00000(Unknown Source)
at org.zefer.html.c.f.Õ00000(Unknown Source)
at org.zefer.html.c.f.return(Unknown Source)
at org.zefer.html.c.f.oo0000(Unknown Source)
at org.zefer.html.c.f.õO0000(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)March 6, 2013 at 07:51#29241Did you override the default max heap size with -Xmx???m JVM command line parameter? The default value as a rule is not sufficient for HTML rendering.
March 6, 2013 at 08:32#29242yes, it is set to 256m
March 6, 2013 at 10:19#29243HTML rendering (especially of that big docs) is a resource consuming task. We recommend to set at least 512m, but 1gig is better.
It does not mean JVM immediately allocates the memory – it only defines a limit for peak cases.
March 2, 2015 at 06:53#29244Hi Team,
Are you planning to use some stream or writer so it can handle big pdf. 17 MB html file should not be big. Ideally framework should allow 1 GB html file to pdf.
Thanks
RamMarch 2, 2015 at 18:48#29245I am afraid, a streamed or serialized HTML-to-PDF conversion is not possible – a document must be rendered in memory completely before it is converted to PDF. There is always a possibility that at the end of a document there is an HTML tag or a content portion, which would require a complete document re-layouting.
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
