|
It would be advisable to process this file chunks
at a time. e.g. is the file database generated? If so it probably consists of
lots of 'rows' which are document fragments that can be processed by themselves
as they are parsed then garbage collected.
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
|
- [dom4j-user] how big can dom4j handle? ASTI Legaspi, Calen Martin D.
- James Strachan
