[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

memory leaks after java-calls

Subject: memory leaks after java-calls
From: "Lensch, Thomas" <Lensch@xxxxxxxx>
Date: Thu, 15 Feb 2007 13:00:49 +0100
 memory leaks after java-calls
Hi,

i'm using xalan (2.6.0), xerces (2.6.2).

My xsl script calls java:

java:de.juris.util.SimpleHTMLDiff.getSimpleHTMLDiffAsDOM($in1, $in2)

$in1 and $in2 contain some data (String).

The java code looks as follows:

public static DocumentFragment getSimpleHTMLDiffAsDOM(String left,
String right) {
 // do something with these Strings, result kept in String fragment
 // and then:
			// Create a DOM builder and parse the fragment
			DocumentBuilder dBuilder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
			dBuilder.setErrorHandler(null);
			Document d = dBuilder.parse(new InputSource(new
StringReader(fragment)));

			DocumentFragment docfrag =
d.createDocumentFragment();
			Node node = d.getDocumentElement();

			// Move the nodes into the fragment
			while (node.hasChildNodes())
			{

docfrag.appendChild(node.removeChild(node.getFirstChild()));
			}

			// Return the fragment

			return docfrag;
}

Because xalan runs in an web (tomcat) environment many of these calls
come in and used memory grows.

It seems that all these docfrags are kept in memory, isn't it?
Does the garbage collector find all these docfrags which aren't needed
any more?
Is it possible to change this behaviour so that the docfrags are deleted
in memory?

Best regards,
Thomas

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.