AlexKovic / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

Java Heap Space error when using blogspot as openid provider #99

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. just pick any blogspot account as openid e.g. http://jblooming.blogspot.com/
2. it works fine with several other providers (yahoo, google, wordpress etc.)

What is the expected output? What do you see instead?

Instead of redirecting the response parser never exits and gets "Java heap
space error" 

What version of the product are you using? On what operating system?
0.9.5.593 on windows with jdk 6

Original issue reported on code.google.com by robi...@gmail.com on 16 Sep 2009 at 8:42

GoogleCodeExporter commented 8 years ago
0.9.5 on Ubuntu-8.10 with JDK 6
with blogspot URL: http://alnahian.blogspot.com

java.lang.OutOfMemoryError: Java heap space
    org.apache.xerces.util.XMLStringBuffer.append(Unknown Source)
    org.cyberneko.html.HTMLScanner$SpecialScanner.scanCharacters(HTMLScanner.java:30
11)
    org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2845)
    org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:877)
    org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
    org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
    org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    org.openid4java.discovery.yadis.CyberNekoDOMYadisHtmlParser.parseDocument(CyberN
ekoDOMYadisHtmlParser.java:102)
    org.openid4java.discovery.yadis.CyberNekoDOMYadisHtmlParser.getHtmlMeta(CyberNek
oDOMYadisHtmlParser.java:42)
    org.openid4java.discovery.yadis.YadisResolver.getHtmlMeta(YadisResolver.java:306
)
    org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver
.java:414)
    org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:233)
    org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:221)
    org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:179)
    org.openid4java.discovery.Discovery.discover(Discovery.java:134)
    org.openid4java.discovery.Discovery.discover(Discovery.java:114)
    org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:527)

Original comment by arwolf1...@gmail.com on 23 Feb 2010 at 1:51

GoogleCodeExporter commented 8 years ago
The same problem occurs with:
http://creative-network.blogspot.com/

Original comment by gerard.burnside@gmail.com on 25 Mar 2010 at 5:44

GoogleCodeExporter commented 8 years ago
I think this is a very urgent and serious problem since it crash a system. When 
do you think you can fix this? Are there any workarounds?

Original comment by rjobe...@googlemail.com on 9 Dec 2010 at 1:50

GoogleCodeExporter commented 8 years ago
I think you should increase the max heap size of the JVM using -Xmx.

Original comment by zhoushu...@gmail.com on 9 Dec 2010 at 4:26

GoogleCodeExporter commented 8 years ago
When I was testing I had more than 1Gb of space reserved for the JVM so I think 
this is not the case.

If it is, I suppose the problem is there anyway because this library can't 
require enormous amount of memory just to parse a response :)

Original comment by a...@nibbles.it on 9 Dec 2010 at 5:23

GoogleCodeExporter commented 8 years ago
Would you please provide more detail information, especially the JVM option 
-Xmx.

Original comment by zhoushu...@gmail.com on 9 Dec 2010 at 5:29

GoogleCodeExporter commented 8 years ago
For more about the maximum heap size, search `-Xmxn' on this page 
http://download.oracle.com/javase/6/docs/technotes/tools/windows/java.html

Reserve 1Gb for JVM does not mean the JVM can use 1Gb, it is limited by the 
option -Xmx.

Original comment by zhoushu...@gmail.com on 9 Dec 2010 at 5:37

GoogleCodeExporter commented 8 years ago
OK, here is a minimal example that triggers the error. Tested with 

> java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) 64-Bit Server VM (build 16.0-b13, mixed mode)

I get the following stacktrace after around 1 minute:

starting discovery for http://beestonblog.blogspot.com/
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at org.apache.xerces.util.XMLStringBuffer.append(Unknown Source)
    at org.cyberneko.html.HTMLScanner$SpecialScanner.scanCharacters(HTMLScanner.java:3011)
    at org.cyberneko.html.HTMLScanner$SpecialScanner.scan(HTMLScanner.java:2845)
    at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:877)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:495)
    at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:448)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.openid4java.discovery.yadis.CyberNekoDOMYadisHtmlParser.parseDocument(CyberNekoDOMYadisHtmlParser.java:102)
    at org.openid4java.discovery.yadis.CyberNekoDOMYadisHtmlParser.getHtmlMeta(CyberNekoDOMYadisHtmlParser.java:42)
    at org.openid4java.discovery.yadis.YadisResolver.getHtmlMeta(YadisResolver.java:306)
    at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:414)
    at org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:233)
    at test.OpenIDTest.main(OpenIDTest.java:13)

When I try to start deeper in the stacktrace (e.g., with 
CyberNekoDOMYadisHtmlParser.getHtmlMeta()) I can't trigger this behaviour.

Note: the above mentioned blogspot-URLs did not work for me.

Original comment by rjobe...@googlemail.com on 10 Dec 2010 at 2:05

Attachments:

GoogleCodeExporter commented 8 years ago
OK, I got it. This is caused by the bug of nekohtml, see 
http://sourceforge.net/tracker/?func=detail&aid=1965055&group_id=195122&atid=952
178

Original comment by zhoushu...@gmail.com on 10 Dec 2010 at 3:35

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r648.

Original comment by zhoushu...@gmail.com on 10 Dec 2010 at 3:44

GoogleCodeExporter commented 8 years ago
Thanks for quickly solving this issue! This solution is also helpful for older 
versions of openid4java.

Original comment by rjobe...@googlemail.com on 14 Dec 2010 at 7:51