SarannyaRaj / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
0 stars 0 forks source link

java.lang.OutOfMemoryError: Java heap space --- error getting in validation #254

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
PROBLEM:

While validate the ePub using "epubcheck-3.0.jar", Am getting the below error 
message.

Epubcheck Version 3.0

Validating against EPUB version 3.0
java.lang.OutOfMemoryError: Java heap space
        at java.lang.AbstractStringBuilder.<init>(Unknown Source)
        at java.lang.StringBuilder.<init>(Unknown Source)
        at org.idpf.epubcheck.util.css.CssToken$TokenBuilder.<init>(CssToken.jav
a:363)
        at org.idpf.epubcheck.util.css.CssToken$TokenBuilder.<init>(CssToken.jav
a:369)
        at org.idpf.epubcheck.util.css.CssScanner.scan(CssScanner.java:93)
        at org.idpf.epubcheck.util.css.CssParser.scan(CssParser.java:154)
        at org.idpf.epubcheck.util.css.CssParser.parse(CssParser.java:93)
        at org.idpf.epubcheck.util.css.CssParser.parse(CssParser.java:84)
        at com.adobe.epubcheck.css.CSSChecker.runChecks(CSSChecker.java:121)
        at com.adobe.epubcheck.opf.OPFChecker.checkItemContent(OPFChecker.java:3
87)
        at com.adobe.epubcheck.opf.OPFChecker.runChecks(OPFChecker.java:152)
        at com.adobe.epubcheck.ocf.OCFChecker.runChecks(OCFChecker.java:205)
        at com.adobe.epubcheck.api.EpubCheck.validate(EpubCheck.java:206)
        at com.adobe.epubcheck.tool.Checker.validateFile(Checker.java:171)
        at com.adobe.epubcheck.tool.Checker.run(Checker.java:227)
        at com.adobe.epubcheck.tool.Checker.main(Checker.java:181)

*************************************************************************

The ePub file size is around 80MB. It is not getting full validation.

Thanks,
Sundar

Original issue reported on code.google.com by me.sunda...@gmail.com on 11 Mar 2013 at 12:50

GoogleCodeExporter commented 8 years ago
Java heap space error means that your local Java VM has not enough memory. How 
much RAM does your system have?

You can increase the memory for Java VM with additional parameter -Xmx:
{{{
java -Xmx128M -jar epubcheck-3.0.jar ....
}}}
This sample increases Java heap space to 128 MB.

I tested an 125 MB EPUB and haven't had any problems with that. TaskManager on 
Windows said Java used up to 40 MB memory during validation.

Please test -Xmx parameter and let us know if the issue still exists.

Just out of curiosity: How big is your CSS file (lines and kb)? And is it 
valid? _(online validator http://jigsaw.w3.org/css-validator/ )_

Original comment by tobias.c...@gmail.com on 23 Mar 2013 at 6:28

GoogleCodeExporter commented 8 years ago
Hi,

Thanks for your response.

I have checked the below instance and am getting the same below issue is
coming. While validating the same ePub file in ePubcheck-3.0B4, it is
showing errors and warinings. The same ePub is not validated against
ePubcheck3.0 version. Please guide me on this.

java.lang.OutOfMemoryError: Java heap space
        at org.idpf.epubcheck.util.css.CssReader.mark(CssReader.java:287)
        at org.idpf.epubcheck.util.css.CssReader.peek(CssReader.java:138)
        at org.idpf.epubcheck.util.css.CssScanner.scan(CssScanner.java:95)
        at org.idpf.epubcheck.util.css.CssParser.scan(CssParser.java:154)
        at org.idpf.epubcheck.util.css.CssParser.parse(CssParser.java:93)
        at org.idpf.epubcheck.util.css.CssParser.parse(CssParser.java:84)
        at com.adobe.epubcheck.css.CSSChecker.runChecks(CSSChecker.java:121)
        at
com.adobe.epubcheck.opf.OPFChecker.checkItemContent(OPFChecker.java:3
87)
        at com.adobe.epubcheck.opf.OPFChecker.runChecks(OPFChecker.java:152)
        at com.adobe.epubcheck.ocf.OCFChecker.runChecks(OCFChecker.java:205)
        at com.adobe.epubcheck.api.EpubCheck.validate(EpubCheck.java:206)
        at com.adobe.epubcheck.tool.Checker.validateFile(Checker.java:171)
        at com.adobe.epubcheck.tool.Checker.run(Checker.java:227)
        at com.adobe.epubcheck.tool.Checker.main(Checker.java:181)

Original comment by me.sunda...@gmail.com on 25 Mar 2013 at 8:55

GoogleCodeExporter commented 8 years ago
Sundar, is there any chance you could share the epub file or an obfuscated 
version of it with us? You can either attach it here or send it privately to 
me. 

Original comment by markus.g...@gmail.com on 25 Mar 2013 at 11:17

GoogleCodeExporter commented 8 years ago
Sundar, please see the request for sharing a file above. We cannot repeat this 
problem, and need your file to do so. If this is not possible, please just let 
us know this anyway. 

Original comment by markus.g...@gmail.com on 8 Apr 2013 at 10:00

GoogleCodeExporter commented 8 years ago

Original comment by markus.g...@gmail.com on 14 Apr 2013 at 8:51