process large file

Jimmy Zhang

Usenet Archive
Joined
Feb 3, 2000
Messages
69
Reaction score
0
I am having some trouble processing some large file (40mb) in Java. For the problem I have, I have tried to use SAX, but doesn't find it suitable (well, coding just becomes a little complicated). So DOM is better but a little overhead on memory. Can someone share with me their experiences in dealing with their situations?

Cheers,
JZ
 

Toivo Lainevool

Usenet Archive
Joined
Jun 10, 2000
Messages
14
Reaction score
0
[QUOTE="Jimmy Zhang" wrote:
I am having some trouble processing some large file (40mb) in Java. For the
problem I have, I have tried to use SAX, but doesn't
find it suitable (well, coding just becomes a little complicated). So DOM is
better but a little overhead on memory. Can someone share with me their
experiences in dealing with their situations?[/QUOTE]One good option is to use a pull parser. It has a simpler interface than SAX, but doesn't have the memory overhead of DOM.

See http://www.extreme.indiana.edu/xgws/xsoap/xpp/ or http://www.xmlpull.org/

Toivo Lainevool
http://www.XMLPatterns.com - Develop effective DTDs and XML Schema documents for your XML using structural design patterns.
 

Alexey Shirshov

Usenet Archive
Joined
Apr 8, 2004
Messages
2
Reaction score
0
Hello, Toivo!
You wrote on 7 Apr 2004 12:09:05 -0700:

[Sorry, skipped]

TL> One good option is to use a pull parser. It has a simpler interface TL> than SAX, but doesn't have the memory overhead of DOM.

TL> See http://www.extreme.indiana.edu/xgws/xsoap/xpp/ or TL> http://www.xmlpull.org/

Intresting, that MS calls it cursor model processing (XPathNavigator), and based on SAX calls push/pull model (XmlWriter/XmlReader).

With best regards, Alexey Shirshov.
 

Jimmy Zhang

Usenet Archive
Joined
Feb 3, 2000
Messages
69
Reaction score
0
How much memory does XPathNavigator consume? I assume it loads everything in memory like DOM.
 

Alexey Shirshov

Usenet Archive
Joined
Apr 8, 2004
Messages
2
Reaction score
0
Hello, Jimmy!
You wrote on Thu, 08 Apr 2004 23:40:00 GMT:

JZ> How much memory does XPathNavigator consume? I assume it loads JZ> everything in memory like DOM.

Well, XPathNavigator is just an interface (actually abstract class) and we cann't talk about it performance. The important thing is an implementation of this class. XmlDocument, which represents DOM implements it in DocumentXPathNavigator class. You can create the instance of this class via CreateNavigator method. Another implementation you can get via CreateNavigator of the XPathDocument class. First implementation uses DOM as underlying data model, while the second - XPath data model. I think, for very large documents the XPathDocument will be much faster.

[Sorry, skipped]

With best regards, Alexey Shirshov.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top