Justin M Wozniak <[EMAIL PROTECTED]> wrote on 11/06/2006 12:03:38 AM:

> 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?

Perhaps. You should ask this question on one of the Xalan mailing lists.

> Using JDK 1.5.0.

If you're using the parser/transformer in JDK 5.0 you're using Sun's (2 to 
3 year old) fork of Xerces/Xalan. It's possible the issue you're having 
has long been fixed or never existed in Apache.

> 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]

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

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

Reply via email to