I'm sorry, Michael. I wouldn't know a jHat heap analysis if I tripped over it. However, I did try running two different implementations. In one I just stored the nodes I needed from lookup.xml in a variable and called the variable over and over again (with different filters).  In another I used a key to do the same thing.

I put the <xsl: value-of select="saxon:discard-document('lookup.xml')"/> in the same spot for both implementations. The key implementation used a steadily increasing amount of memory while the variable implementation did not.

This makes me think that there are not any external references preventing gc because other than how I accessed the data, the two implementations used the same structure.

It turns out that the variable implementation was faster because it required significantly less filtering after the call as compared to the key implementation. Some of my filters are base on "less than" operators rather than "equal" operators, so they are not easy to fold into the key-value declaration. When this happens again, I might figure out how to do a jHat heap analysis and get back to you.

Thanks,

David

On Tue, Feb 28, 2012 at 4:42 PM, Michael Kay <mike@saxonica.com> wrote:
I can't see any obvious reason why calling saxon:discard-document() on the lookup document at the end of processing shouldn't work. It should certainly make the lookup document available for garbage collection, and I think that it should also make the index eligible for gc as well. There's always a possibility that there are some references to nodes in the lookup document somewhere, however. And of course, being eligible for garbage collection isn't the same as being garbage-collected. Have you tried doing a jHat heap analysis?

Michael Kay
Saxonica


On 28/02/2012 15:24, David Rudel wrote:
Hello,

I have an XSL stylesheet that processes many source documents one at a time. Each source document is related to a separate lookup document.

These lookup documents are referenced many times, so I have used a key to speed up the performance.

Unfortunately, I don't know how ask the processor to flush the memory associated with the indexed lookup table after I am through using it.

I tried key('keyname', 'keyvalue', saxon:discard-document('lookup.xml')), but that appeared to defeat the purpose of creating the key in the first place. The performance was highly degraded, and I can only assume the problem is that the processor immediately flushes the memory after the command.

I also tried putting a <xsl:value-of select="saxon:discard-document(document('look-up.xml'))/a" /> at the end of each process loop (there is no "/a" node in lookup.xml), hoping that it would let the processor know that I no longer cared about look-up.xml. That trick has worked in the past (e.g., when I needed to use "doc-available" and then had to make sure afterward that the document was flushed from memory.

Thanks,
David



--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help



--

"A false conclusion, once arrived at and widely accepted is not dislodged easily, and the less it is understood, the more tenaciously it is held." - Cantor's Law of Preservation of Ignorance.