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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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)

    #29241

    Did 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.

    #29242

    yes, it is set to 256m

    #29243

    HTML 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.

    #29244

    Hi 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
    Ram

    #29245

    I 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.

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

The forum ‘General questions / FAQ’ is closed to new topics and replies.