Hello,
 
I am using Xalan to evaluate a very simple XPATH on a DOM.  Its using and leaking huge amounts of memory.  How do I eliminate / minimize the memory leak.  The code is as follows.  Its taken for the sample code in the 2.5.2. distribution.
 
  String xpathExpression = elementName + "[EMAIL PROTECTED]"" + type + "\"]";
  XPathEvaluator evaluator = new XPathEvaluatorImpl( _document);
  XPathNSResolver resolver = evaluator.createNSResolver( _document);
  Node node = null;
  XPathResult result = (XPathResult)evaluator.evaluate( xpathExpression, _document.getDocumentElement(), resolver, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);
  while ((node = result.iterateNext()) != null) {
   element = (Element)node;
  }
  result = null;
  resolver = null;
  evaluator = null;
  System.gc();
Any help would be greatly appreciated,
Sanjoy

Reply via email to