File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Parse Dom - java.lang.OutOfMemoryError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Parse Dom - java.lang.OutOfMemoryError" Watch "Parse Dom - java.lang.OutOfMemoryError" New topic

Parse Dom - java.lang.OutOfMemoryError

Per Lovdinger
Ranch Hand

Joined: Jun 11, 2001
Posts: 35
When parsing a big xml-document using DOM I get
a OutOfMemoryError.
I'm using apache.xerces as parser.
I read that a "deferred DOM" might solve the problem.
What is the syntax in xerces to use a "deferred DOM" when I parse ?
..thanks in advance Per
Donny Wi

Joined: Jan 24, 2002
Posts: 13
Sorry, I can't answer your questions.. but I might have a work-around to your problem.
I believe that DOM parser will try to put everything inside the memory when it is parsing an XML file, but SAX parser will parse the file while it is reading the XML file. So, you might want to look at SAX parser.

Donny Widjaja
I agree. Here's the link:
subject: Parse Dom - java.lang.OutOfMemoryError
It's not a secret anymore!