Hello list!
 
When i do this i am able to catch the OutOfMemoryError
 
 static String str="a";
 public static void main(String args[])
 {
 try
  {
    for(;;)
    str+=str;
  }
  catch(java.lang.OutOfMemoryError e)
  {   javax.swing.JOptionPane.showMessageDialognull,"OutOfMEmory caught"); 
  }
}
 
but this doesn't happen when i go on appending child in Xmldom using Apache xerces in java.------------------
try
{
  DocumentImpl docimpl=new DocumentImpl();
  Element root=docimpl.createElement("root");
  docimpl.appendChild(root);
  doc=(Document)docimpl;
  for(int i=0;;i++)
  {
   Element e=doc.createElement("sau"+i);
   root.appendChild(e);
  }
}
catch(java.lang.OutOfMemoryError e)
 {
   javax.swing.JOptionPane.showMessageDialognull,"OutOfMEmory caught"); 
  }
Does Apache make a seperate thread for Dom updation or OutOfMemory is implicitly caught in the Apache-Xerces Java parser
If this isn't so then what's the reason behind this ??
Kindly update me as soon as possible
 
 
Best Wishes,
Saurabh Jain

Reply via email to