HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML Forums › Technical questions / Troubleshooting › java.lang.OutOfMemoryError
- This topic has 2 replies, 1 voice, and was last updated Oct 11, 2022
06:31:49 by marktoddy.
-
AuthorPosts
-
July 17, 2019 at 02:37#33493
Apparently “colspan” is not a valid attribute for “TD” HTML. But why I’m getting a OutOfMemoryError error?
error log:
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}
java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.zefer.html.parser.g.o00000(Unknown Source)
at org.zefer.html.parser.b.õo0000(Unknown Source)
at org.zefer.html.parser.b.ÔÒ0000(Unknown Source)
at org.zefer.html.parser.f.oo0000(Unknown Source)
at org.zefer.html.parser.f.intsuper(Unknown Source)
at org.zefer.html.parser.f.ö00000(Unknown Source)
at org.zefer.html.parser.f.öO0000(Unknown Source)
at org.zefer.html.parser.f.ÔO0000(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.html.doc.e.super(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.r.super(Unknown Source)
at org.zefer.html.doc.r.Òô0000(Unknown Source)
at org.zefer.html.doc.o.Ò00000(Unknown Source)
at org.zefer.html.doc.o.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.Document.layout(Unknown Source)
at org.zefer.html.doc.e.super(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.r.super(Unknown Source)
at org.zefer.html.doc.r.Òô0000(Unknown Source)
at org.zefer.html.doc.o.Ò00000(Unknown Source)
at org.zefer.html.doc.o.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.zefer.html.parser.g.o00000(Unknown Source)
at org.zefer.html.parser.b.õo0000(Unknown Source)
at org.zefer.html.parser.b.ÔÒ0000(Unknown Source)
at org.zefer.html.parser.f.oo0000(Unknown Source)
at org.zefer.html.parser.f.öO0000(Unknown Source)
at org.zefer.html.parser.f.ÔO0000(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.html.doc.e.super(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.r.super(Unknown Source)
at org.zefer.html.doc.r.Ó00000(Unknown Source)
at org.zefer.html.doc.o.Ò00000(Unknown Source)
at org.zefer.html.doc.o.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.Document.layout(Unknown Source)
at org.zefer.html.doc.e.super(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.r.super(Unknown Source)
at org.zefer.html.doc.r.Òô0000(Unknown Source)
at org.zefer.html.doc.o.Ò00000(Unknown Source)
at org.zefer.html.doc.o.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
at org.zefer.html.doc.view.d.o00000(Unknown Source)
at org.zefer.html.doc.eb.super(Unknown Source)
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: Java heap space
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
TableCellElement(td) {colspan=8, vertical-align=top, font-size=9, font-family=arial, font-weight=normal, display=table-cell}java.lang.OutOfMemoryError: GC overhead limit exceeded
July 17, 2019 at 10:33#33494In fact “colspan” is a valid attribute for TD and it does not seem it causes the exception. OutOfMemoryError is an indication of a resource (memory) exhaustion.
How big is the source HTML document? Do you run PD4ML with -Xmx??? JVM parameter?
October 11, 2022 at 06:31#35278This is a runtime error in Java which occurs when you allocate a new object in your application over a period of time continuously and the Garbage Collector (GC) cannot make space available to accommodate a new object, and the heap cannot be expanded further, which resulted this error.
Therefore you pretty much have the following options:
Find the root cause of memory leaks with help of profiling tools like MAT, Visual VM , jconsole etc. Once you find the root cause, You can fix this memory leaks.
Optimize your code so that it needs less memory, using less big data structures and getting rid of objects that are not any more used at some point in your program.
Increase the default memory your program is allowed to use using the -Xmx option (for instance for 1024 MB: -Xmx1024m). By default, the values are based on the JRE version and system configuration.Increasing the heap size is a bad solution, 100% temporary, because you will hit the same issue if you get several parallel requests or when you try to process a bigger file. To avoid OutOfMemoryError, write high performance code:
Use local variables wherever possible.
Release those objects which you think shall not be needed further.
Avoid creation of objects in your loop each time. -
AuthorPosts
You must be logged in to reply to this topic.