Garbage collection of xsl:key indexes
When Saxon builds an index in support of an xsl:key definition, or an implicit xsl:key generated by the XSLT/XQuery optimizer, the intent is that the key remains in memory so long as BOTH the source document AND the compiled stylesheet or query remain in memory.
This appears not to be working. If we run the same query 1000 times against the same source document, we're seeing the index built 95 times. This suggests the garbage collector is destroying it and we're having to rebuild it the next time it's used.
We use WeakReferences to support this policy, and it looks as if we're getting it wrong.
Note: we also need to check how this works on Saxon-CS, as it's probably different.
Please register to edit this issue