Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#21 Temporary trees not garbage collected

v6.4
closed
Michael Kay
5
2012-10-08
2001-08-06
Michael Kay
No

An unforseen consequence of the fix to 441078 is that
temporary trees (result tree fragments) are now
registered in the document pool, which means they will
not be garbage collected until the end of a
transformation. For a transformation that uses many
temporary trees, this can result in excessive memory
consumption.

Note that the temporary tree is not registered in the
document pool unless it is used as a node-set, i.e.
in ways that XSLT 1.0 does not permit, for example by
using the variable in a path expression such as
$tree/nodes. If it used simply as a string, or in
xsl:copy-of, it is not registered and will therefore
still be garbage-collected when no longer in use.

(Source code note: The problem applies to both
implementations of temporary trees, FragmentValue and
TextFragmentValue)

Discussion