You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Gude Reshma <re...@yahoo.com> on 2002/08/21 07:13:47 UTC

Memory consideratino in creating XML using DOM

hi

if memory is an important consideration , is it advisable to create an XML using DOM? specially a large XML file?

if not then what is the alternative?



---------------------------------
Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: Memory consideratino in creating XML using DOM

Posted by Elena Litani <el...@ca.ibm.com>.
Jan Dvorak wrote:
> Another alternative, which I like more and more,
> is the dom4j (www.dom4j.org) ElementHandler idea.
> This gives you a chance to erase portions of the tree
> during the parse, when you are done with them.

The latest Xerces 2 code provides implementation for DOMBuilderFilter
defined in the DOM L3 LS Working Draft [1].
It is similar to ElementHandler in dom4j.

[1]
http://www.w3.org/TR/2002/WD-DOM-Level-3-LS-20020725/load-save.html#LS-DOMBuilderFilter
-- 
Elena Litani / IBM Toronto

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: Memory consideratino in creating XML using DOM

Posted by Fredrik <fr...@cimade.com>.
We use Xerces for large files up to 30 MB. We still havnt have time to
rewrite it to SAX and we do get about 15 - 20 times larger memory usage
(using 1.5.2) than the file.
The real problem is that Xerces crashes when windows start swapping memory
if all pysical memory is used. Still Xerces is much better than explorer who
use about 80 -90 times more memory!
SO, anybody thinking about using DOM for file larger than 10 MB - don't do
it - use SAX.

-----Mensaje original-----
De: Jan Dvorak [mailto:jan.dvorak@mathan.cz]
Enviado el: miércoles 21 de agosto de 2002 14:33
Para: xerces-j-user@xml.apache.org; Gude Reshma
Asunto: Re: Memory consideratino in creating XML using DOM


Hi,

Folklore has it that the DOM in memory can take up
five to ten times the size of the document file.

The alternative is, of course, SAX.
But programming for SAX is not easy.

Another alternative, which I like more and more,
is the dom4j (www.dom4j.org) ElementHandler idea.
This gives you a chance to erase portions of the tree
during the parse, when you are done with them.

Jan Dvorak


Dne středa 21 srpen 2002 07:13 Gude Reshma napsal(a):
| hi
|
| if memory is an important consideration , is it advisable to create an XML
| using DOM? specially a large XML file?
|
| if not then what is the alternative?
|
|
|
| ---------------------------------
| Do You Yahoo!?
| HotJobs, a Yahoo! service - Search Thousands of New Jobs


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Memory consideratino in creating XML using DOM

Posted by Jan Dvorak <ja...@mathan.cz>.
Hi,

Folklore has it that the DOM in memory can take up 
five to ten times the size of the document file.

The alternative is, of course, SAX. 
But programming for SAX is not easy.

Another alternative, which I like more and more, 
is the dom4j (www.dom4j.org) ElementHandler idea. 
This gives you a chance to erase portions of the tree
during the parse, when you are done with them.

Jan Dvorak


Dne středa 21 srpen 2002 07:13 Gude Reshma napsal(a):
| hi
|
| if memory is an important consideration , is it advisable to create an XML
| using DOM? specially a large XML file?
|
| if not then what is the alternative?
|
|
|
| ---------------------------------
| Do You Yahoo!?
| HotJobs, a Yahoo! service - Search Thousands of New Jobs


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Memory consideratino in creating XML using DOM

Posted by Joseph Kesselman <ke...@us.ibm.com>.
See http://www.w3.org/DOM/faq.html#SAXandDOM for guidance on this topic.
______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org