Re: [xslt] scoped result tree fragments



On Wed, Jul 07, 2004 at 08:54:50AM -0700, thevakoc-xml yahoo com wrote:
> Hello Daniel,
> 
> The way I use libxslt results in a large number of RVTs being created (SQL
> results returned in XML) and the memory consumption is becoming a large
> problem.  As I understand it all RVTs are created and stored in the transform
> context (ctxt->tmpRVT) and those persist until the end of the transformation. 
> By the end of my longer stylesheets there is a significant amount of "retired"
> RVTs held there.
> 
> I haven't fully thought this through but was wondering if RVTs could be
> stack'ed like variables are, and automatically destructed when they are out of
> scope?  I've been poking around the code trying to understand how exactly that
> all works.
> 
> Any thoughts?

  Well, the ctxt->tmpRVT are supposed to be cleaned up when you exit
their scope i.e. the template where they are declared,
  See the end of xsltApplyOneTemplate() in transform.c that's where
the deallocation occurs. If you don't exit templates, there is no way
for libxslt to know that there is no more reference to them.

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]