Jva Heap space error
hi.
I'm creating an xml file using xerces parser.
creation is fine ..
but when i try to serialise my Document object using
XMLSerialiser.serialize(xmlDoc);
i get heap space error.
i did the memory check and the memory consumption is betwenn 25% to 35%..
is there any way i can optimize serialize function?
or what can i do so that memory utilization is less.
Thanx
Richa
[440 byte] By [
richa.csia] at [2007-11-27 11:54:13]

> XMLSerialiser.serialize(xmlDoc);
> i get heap space error.
> i did the memory check and the memory consumption is
> betwenn 25% to 35%..
Of what, the JVM heap or your system memory?
> there is an error in the createxml class
I have one doubt, but it is very large.
> thanx for the reply.
> if i'm not using Doc then what should i use?
>
> thanx
Use SAX serializing instead.
There are two forms of XML processing. SAX and DOM. DOM from the programmer's viewpoint is probably easier but it is more resource intensive.
When you run into memory issues processing XML the best solution is thus usually to switch to SAX processing instead. This is a more scalable solution (and thus better then increasing the heap size).