jhy/jsoup — Issue #137: Out of Memory Exception for a file with size less than 1KB
Author: vsacheti
Created: 2011-11-08 23:29:59+00:00
State: open

Hello,

I am using jsoup 1.6.1

Here is my sample file

The Rock (1996)

hello
hello

And the code looks like
Document doc = Jsoup.parse(file, "UTF-8");
System.out.println(doc);

And this is the exception, I am getting
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.(String.java:215)
at java.nio.HeapCharBuffer.toString(HeapCharBuffer.java:542)
at java.nio.CharBuffer.toString(CharBuffer.java:1157)
at org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:79)
at org.jsoup.helper.DataUtil.load(DataUtil.java:38)
at org.jsoup.Jsoup.parse(Jsoup.java:89)
at com.yahoo.htmltidy.TestJsoup1.method2(TestJsoup1.java:38)
at com.yahoo.htmltidy.TestJsoup1.main(TestJsoup1.java:71)

Running on eclipse mac.