[jdom-interest] jdom 1.1

Paul Libbrecht paul at activemath.org
Mon Sep 1 06:22:53 PDT 2008


Katia,

what you sent me is bit too much info... and it is not compilable as  
is. Also it will not come to the mailing-list. You need to send a URL.

I have written the below test which seems indeed to confirm your claim  
to my surprise.
Run with your 74Mb DOM-torture, I get the file parsed in 160s with  
jdom-1.0 while I have to break it after 10 minutes in jdom-1.1.

I also had to change the max-heap-size allocated:
- with jdom-1.0, 512Mb was not enough but 1024 was
- with jdom-1.1, 1024 was not enough, the one I interrupted was with  
1500m (but then my machine started to become unresponsive).

The document is what you posted, I suppose it is coming from some  
external source, it seems to be a pretty straight SQL-like document  
with huge child-list somewhere, something for which there are far  
better processors then the all-flexible JDOM! (and even there, there's  
a JDOM contrib that goes in this direction I think, giving a record at  
a time).

paul

PS: my invocations
  java -Xmx1024m -classpath .:jdom\ 1.0/jdom.jar Parse  
catalogueDOM36.xml
  java -Xmx1024m -classpath .:jdom\ 1.1/jdom.jar Parse  
catalogueDOM36.xml
(out-of-memory, see below, also had one with text-append)
  java -Xmx1500m -classpath .:jdom\ 1.1/jdom.jar Parse  
catalogueDOM36.xml


import org.jdom.input.SAXBuilder;
import java.io.File;
public class Parse {
   public static void main(String[] args) throws Throwable {
       long now = System.currentTimeMillis();
       new SAXBuilder().build(new File(args[0]).toURL());
       System.out.println("Have lasted : " +  
(System.currentTimeMillis()-now));
   }
}


Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at org.jdom.ContentList.ensureCapacity(ContentList.java:355)
	at org.jdom.ContentList.add(ContentList.java:234)
	at org.jdom.ContentList.add(ContentList.java:131)
	at java.util.AbstractList.add(AbstractList.java:91)
	at org.jdom.Element.addContent(Element.java:811)


Le 01-sept.-08 à 14:34, katja.radelicki at colruyt.be a écrit :

> ***********************
> Warning: Your file, difference jdom.zip, contains more than 32 files  
> after decompression and cannot be scanned.
> ***********************
> in the attachement you can find all the necessary things. I have  
> tested it again and I got the same strange result.
>
> Regards,
> Katja
>
> Katja,
>
>
> What you describe is scary and I noticed nothing of that.
> Could you make your test-case a bit more easy to reproduce? (the  
> styled text below is not nice to copy, the xml files are missing).
>
>  Posting it all on the web, e.g. as a zip, would help.
> I see that jdom doesn't have a bug tracker, if you prefer such a  
> method, you can happily post this in our bug-tracker  
> (jira.activemath.org, project activemath, component omdocjdom).  
> Maybe we can even discuss a jdom project there.
>
> paul


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2203 bytes
Desc: not available
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20080901/8ea32f43/smime.bin


More information about the jdom-interest mailing list