Yes you certainly can run out of memory on Java, especially processing huge
XML documents. Often massive XML documents are database-generated or contain
regular repeating fragments (like 'rows' from a 'table') which can be
processed one by one and so not requiring the entire document to be in RAM
at once.

There's an entry in the FAQ

http://dom4j.org/faq.html

entitled "How does dom4j handle very large XML documents?"

http://dom4j.org/faq.html#How%20does%20dom4j%20handle%20very%20large%20XML%2
0documents?

The trick is to use ElementHandler's to be notified as certain parts of the
documents are complete (say a 'row') and then prune it from the tree via
element.detach() so that it can be garbage collected.

There's also an example in dom4j/src/samples/LargeDocumentDemo.java and
LargeDocumentDemo2.java

James
----- Original Message -----
From: "ASTI Legaspi, Calen Martin D." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 19, 2001 8:17 AM
Subject: [dom4j-user] Is it possible to run out of memory processing an XML?


> I'm going to be processing huge XML documents, megabytes in size.  My app
> will be running on possibly 64MB machines.  Is there a danger of running
out
> of memory and crashing? or does this never happen with Java?
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user
>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to