[XOM-interest] NUX, StreamingPathFilter and OutOfMemoryError

Wolfgang Hoschek wolfgang.hoschek at mac.com
Thu Nov 22 21:27:22 EST 2007


On Nov 22, 2007, at 8:20 AM, Elliotte Harold wrote:

> Wolfgang Hoschek wrote:
>> Looks like a bug in the java-1.6 SAX XML parser. A heap dump on  
>> OOM  shows that there is a (single!) instance of   
>> com.sun.org.apache.xerces.internal.util.XMLStringBuffer that  
>> consumes  40 MB of memory in a single char[] array.
>> The bug disappears when using an official Apache Xerces release   
>> instead of sun's weird xerces variant, for example via
>> java -Xmx10m -XX:+HeapDumpOnOutOfMemoryError - 
>> Djava.endorsed.dirs=/ Users/hoschek/unix/java/share/apache/ 
>> xerces-2.9.0/
>> I suggest using this route as a workaround.
>
> Interesting. Have you reported this to Sun?
>
> Also, are you sure it's not a Xerces version issue? Could have been  
> a bug in Xerces prior to 2.9.0 if something earluer ships with the  
> JDK.
>

I haven't reported this bug to Sun for lack of time. Feel free to do  
so if you like.

I've now tested other xerces versions as well via - 
Djava.endorsed.dirs. There's no bug with the official Apache releases  
of xerces-2.6.2, xerces-2.7.0, xerces-2.7.1, xerces-2.8.0,  
xerces-2.8.1, xerces-2.9.0, xerces-2.9.1. As far as I can see the bug  
only happens with the xml parser bundled with sun java-1.6, which is  
a fork of some xerces flavour with a variety of unidentifiable mods  
and patches by sun. Also the bug does not happen with what's bundled  
with sun java-1.5.

wolfgang.


More information about the XOM-interest mailing list