I'm having a garbage collection problem.  I have a small server
application that parses Strings to build XML Documents using an
effectively global Transformer.  Using jmap, I noticed that these
DocumentImpl, SAXParser, etc. instances are not being garbage collected
even when other objects are, causing eventual memory problems.  After
processing these Documents definitely fall out of scope; the receiving
class is garbage collected.  Does the Transformer or some other object
hold on to these Documents?

Using JDK 1.5.0.

I'm doing this in a helper class:

  public static Document parse(String s)
  {
    Document doc = builder.newDocument();

    try
    {
      StringReader sr     = new StringReader(s);
      StreamSource source = new StreamSource(sr);
      DOMResult result = new DOMResult(doc);
      transformer.transform(source, result);
      sr.close();
    }


-- 
Justin Michael Joseph Wozniak

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to