DOM heap memory problem and Text element question
Hi All,
I have to parse LOADS (about 3000) of small XML (6k) files and have been using DOM parser... Unfortunately i get a Java Heap out of memory error and i dont know how to solve it... i know i can increase my memory usage but thats only a temporary solution and i was hoping for a better solution. The error occurs on this line:document = builder.parse(fil);
try{
File fil=null;
DocumentBuilder builder =null;
builder = factory.newDocumentBuilder();
for(int i=0;i<str.length;i++){
fil=new File(str[i]);
document[i] = builder.parse(fil);
fil=null;
System.gc();
}
}catch (Exception sxe){sxe.printStackTrace();}
can you suggest anything?
the second probably simpler question that i have is: what constitutes a Text element i.e. which standard tags are assumed to be Text elements?
Thanks for your help
Message was edited by:
Lila_harr
Message was edited by:
Lila_harr>

