XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Steven FancherSubject: Document loading and unloading
Author: Steven Fancher
Date: 11 Jan 2007 05:24 PM
Here is a general question:

When does a document referenced by doc(...) get unloaded from memory?

I'm processing a bunch (>5000) small XML files and I keep blowing the stack.

Does anyone know if there is a rule about this? Is it completely implementation dependent? Should it be when the variable bound to the doc() goes out of scope?

-Steven Fancher

Alberto MassariSubject: Re: Document loading and unloading
Author: Alberto Massari
Date: 12 Jan 2007 03:10 AM
Hi Steven,
as you guessed, it's implementation-dependent; however, the
requirement that every call to doc() must be "stable" (i.e. when
given the same argument, it must return the exact same node tree,
with the same identity) almost forces every implementation to keep
all of them in memory until processing ends.

If you are using Saxon, it defines an extension function to release
such documents, saxon:discard-document (see

Hope this helps,

Steven FancherSubject: Re: Document loading and unloading
Author: Steven Fancher
Date: 12 Jan 2007 09:04 AM
Thanks Alberto. I'll give it a try.

Steven Fancher

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.