2 Replies Latest reply on May 2, 2007 3:31 PM by 807606

    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[i] = 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);
      document[i] = builder.parse(fil);
      } 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:

      Message was edited by: